The problem
I had gatsbyjs, node and npm installed on a Debian system. Now I'm getting this error:
-bash: gatsby: command not found
-bash: node: command not found
-bash: npm: command not found
Troubleshooting
-
Check
npminstallation using the package manager:apt-cache policy npmnpm:
Installed: (none) -
Check
nvminstallation:nvm --version0.39.3
This means Node JS was installed using Node Version Manager.
-
Check node versions installed locally through
nvm:nvm lsv14.21.3
v16.19.0
v18.14.0
default -> lts/* (-> N/A)
node -> stable (-> v18.14.0) (default)
stable -> 18.14 (-> v18.14.0) (default)
Solution
nvm use stable
Now using node v18.14.0 (npm v9.3.1)