2017-04-01 160 views
0

我是新來的NodeJS試圖在全球範圍內使用窗口8.1 以管理員身份運行的CMDNPM與窗口的CMD安裝錯誤

安裝NPM模塊,即節點-dev的

每次我嘗試安裝npm時,都會出現此錯誤。

npm ERR! Windows_NT 6.3.9600 

npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\ 
node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "node-dev" 

npm ERR! node v6.10.1 

npm ERR! npm v3.10.10 

npm ERR! code ENOTFOUND 

npm ERR! errno ENOTFOUND 

npm ERR! syscall getaddrinfo 

npm ERR! network getaddrinfo ENOTFOUND registry.nmpjs.org registry.nmpjs.org:80 

npm ERR! network This is most likely not a problem with npm itself 

npm ERR! network and is related to network connectivity. 

npm ERR! network In most cases you are behind a proxy or have bad network setti 
gs. 
npm ERR! network 

npm ERR! network If you are behind a proxy, please make sure that the 
npm ERR! network 'proxy' config is set properly. See: 'npm help config' 

我做了一些搜索,並看到一些類似的情況,其中沒有一個已經解決了Windows的情況。

那麼有什麼交易?這是一個奇怪的邊緣案例缺陷,沒有解決方案嗎?

+0

argv錯誤顯示無效的WIndows pathspec「C:\\ Program Files \\ nodejs \\ node.exe」「C:\\ Program Files \\ nodejs \ node_modules \\ npm \\ bin \\ npm-cli .js「 - 嘗試使用單個反斜槓argv」C:\ Program Files \ nodejs \ node.exe「」C:\ Program Files \ nodejs \ node_modules \ npm \ bin \ npm-cli.js「 - 以及當然,檢查預期的文件是否在預期的位置。 – Elvn

回答

0

嘗試

npm cache clean 

然後

npm install -g <package_name> 

如果這不起作用

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

和嘗試,安裝軟件包。