I\'m learning laravel and follwing this tutorial,
But when I went try and install npm, is says bash: npm: command not found
I know it's an old question. But it keeps showing in google first position and all it says it's "install node.js". For a newbie this is not obvious, so all you have to do is go to the node.js website and search for the command for your linux distribution version or any other operating system. Here is the link: https://nodejs.org/en/download/package-manager/
In this page you have to choose your operating system and you'll find your command. Then you just log into your console as a root (using putty for instance) and execute that command.
After that, you log as normal user and go again inside your laravel application folder and run again npm install command, and it should work. Hope it helps.
I also come here for the same problem, The solution I found is to install npm and then restart the Visual Studio Code
I am following the same tuturial and I had this issue and how I solved is just download the
from this link then install it then the command worked just fine!
The solution is simple.
After installing Node, you should restart your VScode and run npm install command.
Debian:
cd /tmp/
wget https://deb.nodesource.com/setup_8.x
echo 'deb https://deb.nodesource.com/node_8.x stretch main' > /etc/apt/sources.list.d/nodesource.list
wget -qO - https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add -
apt update
apt install nodejs
node -v
npm -v
In my case it was entirely my fault (as usual) I was changing the system path under the environment variables, in Windows, and messed up the path for Node/NPM. So the solution is to either re-add the path for NPM, see this answer or the lazy option: re-install it which will re-add it for you.