Smitha
Smitha

Reputation: 6134

Npm Error - Windows NT - How to resolve

I get the following error when I try npm install :

npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs
\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! node v0.10.36
npm ERR! npm  v2.12.1

npm ERR! Cannot read property 'latest' of undefined
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs
\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! node v0.10.36
npm ERR! npm  v2.12.1

npm ERR! Cannot read property 'latest' of undefined
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs
\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! node v0.10.36
npm ERR! npm  v2.12.1

npm ERR! Cannot read property 'latest' of undefined
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

What is wrong? I cant use nodejs < 0.10.36 or > 0.11

Upvotes: 10

Views: 32984

Answers (9)

vinny
vinny

Reputation: 138

This error mostly occurs when you use any defender in windows or antivirus software. I have disabled Antivirus software and work right. if a problem does not solve then start your CMD administrator mode and you should point a local registry

npm install --registry http://npm.myserver.com

Upvotes: 0

mondayguy
mondayguy

Reputation: 991

Problem caused by my corporate proxy. Here is solution that worked for me: In the

"C:\Users\USERNAME"

Edit/Create

.npmrc

file with next structure:

registry=https://registry.npmjs.org/
proxy=http://192.168.10.10:1180/
https-proxy=http://192.168.10.10:1180/
strict-ssl=false

use http regitstry if https is blocked by your corporate proxy

Upvotes: 1

Harendra Kr. Jadon
Harendra Kr. Jadon

Reputation: 179

Seems it is a certificate expire issue with:

npm registry https://registry.npmjs.org/

in stead run:

npm set registry http://registry.npmjs.org/

or else run:

npm install -g npm

This helped me!

Upvotes: 1

Ankur Marwaha
Ankur Marwaha

Reputation: 1885

Updating npm solved the problem for me. npm install -g npm

Upvotes: 5

Scott Izu
Scott Izu

Reputation: 2309

You may want to point to a local registry or a registry behind the firewall

npm install --registry http://npm.myserver.com

Upvotes: 2

Ankit Tanna
Ankit Tanna

Reputation: 1819

Change your location of cache. This will definitely work. By default NPM tries to pickup packages from cache and the default location is sometimes prohibited from reading.

npm config set cache C:\Dev\nodejs\npm-cache --global

Cheers!

Upvotes: 6

hhsadiq
hhsadiq

Reputation: 2943

Culprit: Windows real time protection

Turn off the real time protection of Windows Defender (or any other anti-virus) and you will be good to go. I spent a lot of time finding this simple solution but it really works.

Upvotes: 1

Ualter Jr.
Ualter Jr.

Reputation: 2438

Check the information at the log file generated at the same folder you issued the command:

cat npm-debug.log

In my case the error was related a mistake made during typing the content of the package.json:

verbose stack Error: Invalid version: "1.0"

Upvotes: 0

psv
psv

Reputation: 697

You are probably behind a proxy or firewall. Ref. this issue.

To resolve the issue disable any firewall, proxy or antivirus that might interfere.

Upvotes: 0

Related Questions