由于版本不可用,npm install不起作用

时间:2015-01-20 20:45:25

标签: node.js npm gulp

我试图在Windows PC上安装this wordpress template,它依赖于gulp文件的某些节点模块。

npm install的输出如下:

$ npm install
npm WARN package.json gulp-wordpress-template@0.0.1 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: gulp-autoprefixer@'^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!     <npm-@googlegroups.com>

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

根据错误,gulp-autoprefixer在版本^ 1.0.1中不可用。奇怪的是,它下面表明1.0.1是一个有效的版本。

更奇怪的是,我可以在OSX机器上完美地安装软件包。

我认为节点是跨平台的 - 有什么我想念的吗?

1 个答案:

答案 0 :(得分:4)

您需要更新版本的npm,它支持版本字段中的^字符。最简单的方法就是升级节点(截至本文撰写时最新的稳定版本为v0.10.35)。