Nix-shell executable file not found in $PATH during deployment

this is the replit.nix file I’m using for a node server application. it runs fine when I click run and am able to hit the localhost endpoint from shell but deployment keeps failing with this error

exec [nix-shell --run node server.js] error=exec: "nix-shell": executable file not found in $PATH

this is the replit.nix file I’m using:

{pkgs}: {
  deps = [

why not remove this bit and instead add node by running in Shell

nix-editor -hapkgs.nodejs-slim

weirdly I 'm not sure if replit is picking up the changes correctly. I see the same error even after modifying .replit with your suggestion:

entrypoint = "server.js"
modules = ["nodejs-20:v8-20230920-bd784b9"]
hidden = [".config", "package-lock.json"]

channel = "stable-23_05"

language = "nodejs"

deploymentTarget = "cloudrun"
ignorePorts = false
run = ["nix-editor", "-hapkgs.nodejs-slim", "server.js"]

never mind, I just had to do run = ["node", "server.js"]

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.