Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How come npm install doesn't work on git bash

I have git bash open and I type in npm install and then it returns:

bash: npm command not found 

I don't understand, because I have node.js command prompt and when I type in npm -v then it returns 3.7.3. How come it doesn't work in git?

like image 561
damien9999 Avatar asked Mar 10 '16 11:03

damien9999


People also ask

Can I run npm in git bash?

To use Node. JS and NPM, you need to use a suitable command-line tool like the Windows Command Prompt (CMD), PowerShell or the GIT Bash Command-Line Tool.

Why npm install is not working?

On Windows, the cause of this error could be that a PATH or system variable is not correctly set. The error can also occur if you do not have npm or Node. js installed, have an outdated version, or have permission issues.

How do I run node js in git bash?

Just download it at http://nodejs.org and run the installer. * You can install any nodejs module except native one(like `buffertools`). Fortunately, swixweb doesn't depend on any native modules. * You can use `node/npm` commands on the previously installed `git-bash` prompt.


1 Answers

In our case, the solution was simply to close the Git bash window and re-open it.

like image 168
Ben Avatar answered Sep 27 '22 19:09

Ben