安装npm不适用于Windows

时间:2014-10-24 07:34:52

标签: windows node.js gruntjs npm

安装npm在Windows上不起作用

错误

  

npm ERR!错误:未找到兼容版本:grunt-rename @'> = 0.4.1-0   < 0.5.0-0'

     

npm ERR!有效的安装目标:

     

npm ERR! [ “0.1.0”, “0.1.1”, “0.1.2”, “0.1.3”, “0.1.4”]

     

npm ERR!在installTargetsError(C:\ Program Files   (86)\的NodeJS \ node_modules \

     

NPM \ lib中\ cache.js:719:10)

     

npm ERR!在下一个(C:\ Program Files   (86)\的NodeJS \ node_modules \ NPM \ lib中\ cache.j

     

S:698:17)

     

npm ERR!在C:\ Program Files   (86)\的NodeJS \ node_modules \ NPM \ lib中\ cache.js:675:

     

5

     

npm ERR!保存(C:\ Program Files   (86)\的NodeJS \ node_modules \ NPM \ node_modul

     

ES \ NPM-注册表的客户端\ lib中\ get.js:142:7)

     

npm ERR!在C:\ Program Files   (86)\的NodeJS \ node_modules \ NPM \ node_modules \ GRAC

     

eful-FS \ polyfills.js:133:7

     

npm ERR!在Object.oncomplete(fs.js:107:15)

     

npm ERR!如果您需要帮助,可以在以下位置报告此日志:

     

npm ERR! http://github.com/isaacs/npm/issues

     

npm ERR!或通过电子邮件发送至:

     

npm ERR!

     

npm ERR!系统Windows_NT 6.1.7601

     

npm ERR!命令“C:\ Program Files(x86)\ nodejs \\ node.exe”   “C:\ Program File

     

s(x86)\ nodejs \ node_modules \ npm \ bin \ npm-cli.js“”install“

     

npm ERR! cwd C:\ Users \ ra824041 \ Desktop \ grunt \ MyApp npm ERR!节点-v   v0.10.15

     

npm ERR! npm -v 1.3.5

     

npm http 304 https://registry.npmjs.org/grunt-contrib-watch

     

npm http 304 https://registry.npmjs.org/grunt-contrib-compress

     

npm http 304 https://registry.npmjs.org/grunt-contrib-nodeunit

     

npm http 304 https://registry.npmjs.org/grunt-contrib-jshint

     

npm http 304 https://registry.npmjs.org/grunt-stripcomments

     

npm http 304 https://registry.npmjs.org/grunt-usemin

     

npm http 304 https://registry.npmjs.org/grunt-contrib-concat

     

npm http 304 https://registry.npmjs.org/grunt-contrib-uglify

     

npm http 304 https://registry.npmjs.org/grunt-contrib-copy

     

npm http 304 https://registry.npmjs.org/grunt-minified/0.0.6

     

npm http 304 https://registry.npmjs.org/grunt-contrib-qunit

     

npm http 304 https://registry.npmjs.org/grunt-contrib-cssmin

     

npm ERR!

     

npm ERR!其他日志记录详细信息可在以下位置找到:

     

npm ERR! C:\ Users \ ra824041 \ Desktop \ grunt \ Greece 3.6 \ npm-debug.log

     

npm ERR!不好的代码0

的package.json:

{
  "name": "ML",
  "version": "0.1.0",
  "devDependencies": {
    "grunt": "~0.4.1",
    "grunt-rename": "~0.4.1",
    "grunt-contrib-compress": "~0.5.2",
    "grunt-contrib-concat": "~0.3.0",
    "grunt-contrib-copy": "~0.4.1",
    "grunt-contrib-cssmin": "~0.6.1",
    "grunt-contrib-jshint": "~0.6.0",
    "grunt-contrib-nodeunit": "~0.2.0",
    "grunt-contrib-qunit": "~0.2.2",
    "grunt-contrib-uglify": "^0.6.0",
    "grunt-contrib-watch": "~0.4.4",
    "grunt-minified": "0.0.6",
    "grunt-stripcomments": "^0.3.1",
    "grunt-usemin": "~0.1.12"
  }
}

1 个答案:

答案 0 :(得分:3)

这似乎是第一行的问题:

No compatible version found: grunt-rename@'>=0.4.1-0 <0.5.0-0'

将package.json中的grunt-rename更新为[&#34; 0.1.0&#34;,&#34; 0.1.1&#34;,&#34; 0.1.2&#34;,& #34; 0.1.3&#34;&#34; 0.1.4&#34;]

请务必尝试&#34; npm缓存清理&#34;命令