After installing node.js in windows , npm is giving an errorr of prefix"-g" not recognised as an internal or external command.
Even after uninstalling and installing it again , it is giving the same error.
What should I do ?
Node.js Install Problem
Can you send the exact output? Attach a screenshot of command prompt/terminal
Try all the solutions mentioned here: https://stackoverflow.com/questions/38277910/error-while-running-npm-prefix-g-is-not-recognized-as-an-internal-or-external
To do this follow these steps:
Go to control panel -> System -> Advanced System Settings then environment variables.
- Use the global Search Charm to search “Environment Variables”
- Click “Edit system environment variables”
- Click “Environment Variables” in the dialog.
- In the “System Variables” box, search for Path and edit it to include
C:\Program Files\nodejs
. Make sure it is separated from any other paths by a;
. You will have to restart any currently-opened command prompts before it will take effect.
Sir It’s not working . I tried all the methods listed.
Sir What should I do ?
Go to control panel -> System -> Advanced System Settings then environment variables.
- Use the global Search Charm to search “Environment Variables”
- Click “Edit system environment variables”
- Click “Environment Variables” in the dialog.
- In the “System Variables” box, search for Path
Send the screeshot of the window that appears
Send the exact string in variable value
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.