Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error running npm command

Tags:

node.js

npm

I have installed node.js But in command prompt npm command is not identified. I have set environmental variable also. Kindly help me out.

This is the response in command prompt:

C:\Users\593180.INDIA>npm
URIError: URI malformed
at decodeURIComponent (native)
at Url.parse (url.js:179:19)
at Object.urlParse [as parse] (url.js:101:5)
at Object.validateUrl [as validate] (C:\Program Files (x86)\nodejs\node_modu
les\npm\node_modules\nopt\lib\nopt.js:157:13)
at validate (C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\nop
t\lib\nopt.js:205:24)
at validate (C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\nop
t\lib\nopt.js:172:11)
at C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\nopt\lib\nopt
.js:101:12
at Array.map (native)
at C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\nopt\lib\nopt
.js:67:15
at Array.forEach (native)
C:\Program Files (x86)\nodejs\node_modules\npm\lib\npm.js:37
throw new Error('npm.load() required')
      ^
Error: npm.load() required
at Object.npm.config.get (C:\Program Files (x86)\nodejs\node_modules\npm\lib
\npm.js:37:11)
at exit (C:\Program Files (x86)\nodejs\node_modules\npm\lib\utils\error-hand
ler.js:49:27)
at process.errorHandler (C:\Program Files (x86)\nodejs\node_modules\npm\lib\
utils\error-handler.js:314:3)
at process.EventEmitter.emit (events.js:95:17)
at process._fatalException (node.js:272:26)
like image 767
Cherry Avatar asked Jun 11 '14 13:06

Cherry


People also ask

Why is npm command not working?

On Windows, you may face the “npm command not found” error if the path to nodejs and npm are not added to your path variable. To fix this, locate the path to nodejs and npm binaries. The command above should add the specified directory to the path variable.

How do I resolve npm start error?

To solve the Missing script: "start" error, make sure to add a start command to the scripts object in your package. json file and open your shell or IDE in the root directory of your project before running the npm start command.


1 Answers

You probably broke npm by configuring your proxy or other URL

Go into your user folder

C:\Users\username

edit the file ".npmrc"

and fix your proxy url or other corrupted url proxy = http://login:password@proxyaddress:port

like image 192
amdev Avatar answered Sep 22 '22 09:09

amdev