6

When I try to run npm install on windows, I get the following error. How can get rid of it?

D:\Xampp\htdocs\laravelchat>npm install
'CALL "C:\Program Files\nodejs\\node.exe" "C:\Program Files\nodejs\\node_modules\npm\bin\npm-cli.js" prefix -g' is not recognized as an internal or external command,
operable program or batch file.
1
  • Update the environment variables and then try to run it. Commented Nov 16, 2017 at 15:42

2 Answers 2

4

As you can see C:\Program Files\nodejs\\node.exe has two slashes \. You need to remove \ from the end of C:\Program Files\nodejs\ which is defined in environment variable. Follow following steps to set up path for nodejs and npm

  1. Open the system properties (enter sysdm.cpl in command prompt), and click Advanced tab.
  2. Click Environmental Variables. A pop-up window will open displaying Path under System Variables. Check whether the Path is determined as C:\Program Files\nodejs or C:\Program Files (*86)\nodejs. Remember not to include \ at the end. If Path is not determined, append the path manually by clicking Edit.
Sign up to request clarification or add additional context in comments.

5 Comments

this error also showing while checking npm -v, please help
node -v is showing correctly, but npm is not, i have installed and also uninstall, reinstalled it
See the image that I linked in comment and tell whether you selected it or not during installation.
i have watched this image
2

You must install NodeJs if you didn't install it yet. NodeJs

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.