0

I am getting error below, when I am trying to run any npm command like npm install or npm -v I tried to solve the issue by reinstalling the nodejs to latest version. But still no change.Any idea how to solve this? Any kind of help is really appreciated. thanks in advance.

'CALL "D:\laragon\bin\nodejs\node-v12\\node.exe" "D:\laragon\bin\nodejs\node-v12\\node_modules\npm\bin\npm-cli.js" prefix -g' is not recogniz
ed as an internal or external command,
operable program or batch file.

enter image description here

Md Aman Ullah
  • 486
  • 1
  • 5
  • 17
  • Add global node_module bin bath in path https://stackoverflow.com/questions/48321639/is-not-recognized-as-an-internal-or-external-command-operable-program-or-bat – xdeepakv Apr 04 '20 at 15:56

4 Answers4

0

you need to run this command

npm config set prefix C:\Users\yourname\AppData\Roaming\npm
Nadim Al Abdou
  • 768
  • 7
  • 13
0

Update your PATH variable to onclude your node executable.

You need to Add C:\Program Files\nodejs to your PATH environment variable. To do this follow these steps:

  1. Go to Control Panel and search for "Environment Variables"
  2. Click "Edit system environment variables"
  3. Click "Environment Variables"
  4. Go to "System Variables" box, search for Path and edit it to include D:\laragon\bin\nodejs\node-v12\\node.exe. Make sure it is separated from any other paths by a ;.
  5. Open a new command prompt and type node --version to confirm that your variable is set.
Ayman Arif
  • 1,456
  • 3
  • 16
  • 40
0

You can clean the existing setting. By default, it will be in $HOME/.npmrc Remove it and reset.

MAC:

$ mv ~/.npmrc ~/.npmrc.bak
$ npm config set prefix ~/.npm-global // For good control, store all global module here
## In ~/.bash_profile add this
$ PATH=$PATH:~/.npm-global/bin ## set global bin dir in PATH

xdeepakv
  • 7,835
  • 2
  • 22
  • 32
0

Please uninstall your nodejs application from your windows and then restart! after restart try again to install nodejs! When installing nodejs.exe it will ask you for add path, you must check it and finish installation.

Hope it will fixed your problem. Otherwise please let me know! email me: smmahady52@gmail.com

Hasan
  • 41
  • 4