Issue
A user's build has successfully built and released, but at runtime, the app is unable to find node, npm and/or yarn.
You may see something like this:
~ $ npm -v
bash: npm: command not found
~ $ node -v
bash: node: command not found
~ $ yarn -v
bash: yarn: command not found
Resolution
There is likely a script that is running at build-time that is overwriting the Node binaries.
From the root of the app directory, run:
grep -iRl "PATH" .
This will output all the files that has PATH
in them.
Note: If you are running this from a Heroku dyno, you can ignore any files in the .heroku
directory - that comes from the compile step of the build.
If any files have reassigned $PATH
, make sure that they look something like this:
export PATH=/new/binary:/other/new/bin:$PATH
If the :$PATH
is missing from any assignment to PATH
, the binaries from the Heroku build (including node, yarn and npm) will not be available at runtime.