2015-01-20 110 views
2

我試圖在Windows PC上安裝this wordpress template,它依賴於一些吞嚥文件的節點模塊。由於版本不可用,npm安裝不起作用

npm install輸出如下:

$ npm install 
npm WARN package.json [email protected] No repository field. 
npm http GET https://registry.npmjs.org/gulp-load-plugins 
npm http GET https://registry.npmjs.org/gulp-autoprefixer 
npm http GET https://registry.npmjs.org/gulp 
npm http GET https://registry.npmjs.org/browser-sync 
npm http 304 https://registry.npmjs.org/gulp-autoprefixer 
npm ERR! Error: No compatible version found: [email protected]'^1.0.1' 
npm ERR! Valid install targets: 
npm ERR! ["0.0.1","0.0.2","0.0.3","0.0.4","0.0.5","0.0.6","0.0.7","0.0.8","0.0.9 
","0.0.10","1.0.0","1.0.1","2.0.0","2.1.0"] 
npm ERR!  at installTargetsError (c:\Program Files\nodejs\node_modules\npm\li 
b\cache.js:719:10) 
npm ERR!  at c:\Program Files\nodejs\node_modules\npm\lib\cache.js:638:10 
npm ERR!  at saved (c:\Program Files\nodejs\node_modules\npm\node_modules\npm 
-registry-client\lib\get.js:142:7) 
npm ERR!  at c:\Program Files\nodejs\node_modules\npm\node_modules\graceful-f 
s\polyfills.js:133:7 
npm ERR!  at Object.oncomplete (fs.js:107:15) 
npm ERR! If you need help, you may report this log at: 
npm ERR!  <http://github.com/isaacs/npm/issues> 
npm ERR! or email it to: 
npm ERR!  <[email protected]> 

npm ERR! System Windows_NT 6.1.7601 
npm ERR! command "c:\\Program Files\\nodejs\\node.exe" "c:\\Program Files\\nodej 
s\\node_modules\\npm\\bin\\npm-cli.js" "install" 
npm ERR! cwd c:\Users\USER\Desktop\wordpress-test 
npm ERR! node -v v0.10.15 
npm ERR! npm -v 1.3.5 
npm http 304 https://registry.npmjs.org/gulp-load-plugins 
npm http 304 https://registry.npmjs.org/gulp 
npm http GET https://registry.npmjs.org/gulp-connect-php 
npm http GET https://registry.npmjs.org/gulp-shell 
npm http GET https://registry.npmjs.org/gulp-sass 
npm http 304 https://registry.npmjs.org/browser-sync 
npm http 304 https://registry.npmjs.org/gulp-sass 
npm http 304 https://registry.npmjs.org/gulp-connect-php 
npm http 304 https://registry.npmjs.org/gulp-shell 
npm ERR! 
npm ERR! Additional logging details can be found in: 
npm ERR!  c:\Users\USER\Desktop\wordpress-test\npm-debug.log 
npm ERR! not ok code 0 

根據誤差,大口喝,autoprefixer是不是在版本1.0.1 ^可用。奇怪的是,它下面暗示着1.0.1是一個有效的版本。

更奇怪的是,我可以在OSX機器上完美地安裝軟件包。

我以爲節點是跨平臺 - 有什麼我失蹤?

+0

你可以在'packages.json'中顯示'gulp-autoprefixer'的依賴行嗎? – jpmc26 2015-01-20 20:53:42

回答

4

您需要較新版本的npm,才能在版本字段中支持^字符。最簡單的方法就是升級節點(在撰寫本文時最新版本爲v0.10.35)。

+0

謝謝,這工作。但只是重新安裝可執行文件(Windows)不起作用。卸載和全新安裝解決了這個問題。 – amann 2015-01-25 15:04:37