2016-04-30 63 views
0

我最近在我的Windows 8電腦上安裝了節點並測試了它,它似乎工作正常。但是,當我嘗試安裝它,我得到這個錯誤我如何解決這個錯誤安裝npm連接在我的電腦上

npm ERR! Windows_NT 6.2.9200
npm ERR! argv "C:\Program Files\nodejs\\node.exe" "C:\Program Files\nodejs
\node_modules\npm\bin\npm-cli.js" "install" "connect"
npm ERR! node v0.12.4
npm ERR! npm v2.10.1
npm ERR! code EACCES
npm ERR! errno EACCES
npm ERR! syscall connect

npm ERR! Error: connect EACCES
npm ERR! at exports._errnoException (util.js:746:11)
npm ERR! at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1010:19)
npm ERR! { [Error: connect EACCES] code: 'EACCES', errno: 'EACCES', syscall: 'c onnect' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! Please include the following file with any support request:
npm ERR! C:\WINDOWS\system32\npm-debug.log

這些都是NPM-文件的debug.log來自之前,我嘗試安裝以管理員身份運行CMD

0 info it worked if it ends with ok
1 verbose cli [ 'C:\Program Files\nodejs\node.exe',
1 verbose cli 'C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js',
1 verbose cli 'install',
1 verbose cli 'connect' ]
2 info using [email protected]
3 info using [email protected] 4 verbose install initial load of C:\Users\owner\Desktop\Node.js\package.json
5 verbose readDependencies loading dependencies from
C:\Users\owner\Desktop\Node.js\package.json
6 silly cache add args [ 'connect', null ]
7 verbose cache add spec connect
8 silly cache add parsed spec Result {
8 silly cache add raw: 'connect',
8 silly cache add scope: null,
8 silly cache add name: 'connect',
8 silly cache add rawSpec: '',
8 silly cache add spec: 'latest',
8 silly cache add type: 'tag' }
9 silly addNamed [email protected]
10 verbose addNamed "latest" is being treated as a dist-tag for connect
11 info addNameTag [ 'connect', 'latest' ]
12 silly mapToRegistry name connect
13 silly mapToRegistry using default registry
14 silly mapToRegistry registry https://registry.npmjs.org/
15 silly mapToRegistry data Result {
15 silly mapToRegistry raw: 'connect',
15 silly mapToRegistry scope: null,
15 silly mapToRegistry name: 'connect',
15 silly mapToRegistry rawSpec: '',
15 silly mapToRegistry spec: 'latest',
15 silly mapToRegistry type: 'tag' }
16 silly mapToRegistry uri https://registry.npmjs.org/connect
17 verbose addNameTag registry: https://registry.npmjs.org/connect not in flight; fetching 18 verbose request uri https://registry.npmjs.org/connect
19 verbose request no auth needed
20 info attempt registry request try #1 at 11:26:28 PM
21 verbose request id d04b099ed5c5d169
22 http request GET https://registry.npmjs.org/connect
23 info retry will retry, error on last attempt:
Error: connect EACCES 23.235.40.162:443
24 info attempt registry request try #2 at 11:26:38 PM
25 http request GET https://registry.npmjs.org/connect
26 info retry will retry, error on last attempt:
Error: connect EACCES 23.235.39.162:443
27 info attempt registry request try #3 at 11:27:38 PM
28 http request GET https://registry.npmjs.org/connect
29 verbose stack Error: connect EACCES 23.235.46.162:443
29 verbose stack at Object.exports._errnoException (util.js:870:11)
29 verbose stack at exports._exceptionWithHostPort (util.js:893:20)
29 verbose stack at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1061:14)
30 verbose cwd C:\Users\owner\Desktop\Node.js
31 error Windows_NT 6.2.9200
32 error argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "install" "connect"
33 error node v4.4.3
34 error npm v2.15.1
35 error code EACCES
36 error errno EACCES
37 error syscall connect
38 error Error: connect EACCES 23.235.46.162:443
38 error at Object.exports._errnoException (util.js:870:11)
38 error at exports._exceptionWithHostPort (util.js:893:20)
38 error at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1061:14)
38 error { [Error: connect EACCES 23.235.46.162:443]
38 error code: 'EACCES',
38 error errno: 'EACCES',
38 error syscall: 'connect',
38 error address: '23.235.46.162',
38 error port: 443 }
39 error Please try running this command again as root/Administrator.
40 verbose exit [ 1, true ]

我已經嘗試過的內容以管理員身份運行命令「npm install connect」並得到同樣的結果。誰能幫忙?

+0

在另一個節點上使用unix或vm,你可以在這裏粘貼npm-debug.log的內容:) – kevingilbert100

+0

你想在哪個文件夾中安裝這個模塊?根據npm-debug.log的位置,它是system32。如果這是正確的,由於明顯的安全原因,這不會讓你安裝在那裏。嘗試使用其他文件夾。 –

+0

@MarkoGrešak我第一次嘗試安裝它是在桌面文件中沒有工作,我試着以管理員身份運行它,那是當它試圖在系統32中安裝。 – Sparksido

回答

0

發生該錯誤是因爲您可能安裝了具有根權限的節點,但您沒有使用相同的權限執行npm。當您在npm目錄(npm鏈接,npm install -g等)中寫入內容時,您需要使用安裝Node時的權限。

解決此問題的建議方法是安裝nvm-windows並使用它來管理您的節點安裝。這可以防止你不得不繞過你的機器上的權限。