Npm installation throw errors Error: wrong protocol

Hi, I'm new to Node JS, and I'm trying to follow the pattern in the book, and trying to do npm install, I get the following error:

Any help would be greatly appreciated

 C:\Developer\NODE_JS>npm install
    npm WARN package.json chatrooms@0.0.1 No repository field.
    npm WARN package.json chatrooms@0.0.1 No README data
    npm http GET http://registry.npmjs.org/socket.io
    npm http GET http://registry.npmjs.org/mime
    npm http GET http://registry.npmjs.org/socket.io
    npm http GET http://registry.npmjs.org/mime
    npm http GET http://registry.npmjs.org/socket.io
    npm http GET http://registry.npmjs.org/mime
    npm ERR! Error: Invalid protocol
    npm ERR!     at Request.init (C:\Program Files\nodejs\node_modules\npm\node_modules\request\request.js:335:51)
    npm ERR!     at new Request (C:\Program Files\nodejs\node_modules\npm\node_modules\request\request.js:99:8)
    npm ERR!     at request (C:\Program Files\nodejs\node_modules\npm\node_modules\request\index.js:55:11)
    npm ERR!     at RegClient.makeRequest (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-registry-client\lib\request.js:211:13)
    npm ERR!     at RegClient.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-registry-client\lib\request.js:117:17)
    npm ERR!     at null._onTimeout (C:\Program Files\nodejs\node_modules\npm\node_modules\retry\lib\retry_operation.js:32:10)
    npm ERR!     at Timer.listOnTimeout [as ontimeout] (timers.js:110:15)
    npm ERR! If you need help, you may report this *entire* log,
    npm ERR! including the npm and node versions, at:
    npm ERR!     <http://github.com/isaacs/npm/issues>

    npm ERR! System Windows_NT 6.1.7601
    npm ERR! command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
    npm ERR! cwd C:\Developer\NODE_JS
    npm ERR! node -v v0.10.24
    npm ERR! npm -v 1.3.21
    npm ERR!
    npm ERR! Additional logging details can be found in:
    npm ERR!     C:\Developer\NODE_JS\npm-debug.log
    npm ERR! not ok code 0

My Node js config

C:\Developer\NODE_JS>npm config list
; cli configs
registry = "http://registry.npmjs.org/"

; userconfig C:\Users\<uname>\.npmrc
https-proxy = "proxy.<comp>.com:8080"
proxy = "proxy.<comp>.com:8080"
registry = "http://registry.npmjs.org/"

; builtin config undefined
prefix = "C:\\Users\\puppalap\\AppData\\Roaming\\npm"

; node bin location = C:\Program Files\nodejs\\node.exe
; cwd = C:\Developer\NODE_JS
; HOME = C:\Users\<uname>
; 'npm config ls -l' to show all defaults.
+4
source share
3 answers

The problem is resolved after I set the following two properties:

npm config set proxy http://usr:pwd@host:port
npm config set https-proxy http://usr:pwd@host:port
+5
source

The problem is related to the set Windows environment variable http_proxy; while I do not use proxies.

The following command will be displayed on the command line if http_proxy is installed;

set http

If the set deletes the variable with the command below and the problem is resolved.

set http_proxy=

http_proxy . , , " " > "" > " " .

+1

, , ,

: ERR! : : myusername:

[ ]

.npmrc = "http://registry.npmjs.org/" [prefix, cwd, home]

-, - -

request.js [/USR/Library/ node_modules//node_modules/request/request.js] -

, init() request.js

self.proxy="http://registry.npmjs.org/" //at the start of method

!!!

PS: , . ,

0

All Articles