windows - 安装 npm 在 Windows 上不起作用

标签 windows node.js gruntjs npm

安装 npm 在 Windows 上不起作用

错误

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

npm ERR! Valid install targets:

npm ERR! ["0.1.0","0.1.1","0.1.2","0.1.3","0.1.4"]

npm ERR! at installTargetsError (C:\Program Files (x86)\nodejs\node_modules\

npm\lib\cache.js:719:10)

npm ERR! at next (C:\Program Files (x86)\nodejs\node_modules\npm\lib\cache.j

s:698:17)

npm ERR! at C:\Program Files (x86)\nodejs\node_modules\npm\lib\cache.js:675:

5

npm ERR! at saved (C:\Program Files (x86)\nodejs\node_modules\npm\node_modul

es\npm-registry-client\lib\get.js:142:7)

npm ERR! at C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\grac

eful-fs\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 ERR! System Windows_NT 6.1.7601

npm ERR! command "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! node -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! Additional logging details can be found in:

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

npm ERR! not ok code 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"
  }
}

最佳答案

这似乎是第一行的问题:

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

将 package.json 中的 grunt-rename 更新为 ["0.1.0","0.1.1","0.1.2","0.1.3","0.1.4"] 中的任何一个

一定要试试“npm cache clean”命令

关于windows - 安装 npm 在 Windows 上不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26543423/

相关文章:

windows - Heroku CLI 在 babun 中失败

node.js - 获取 CoreMongooseArray 而不是普通数组

c++ - 添加目录路径 Windows 8.1

windows - Postgres 恒定 30% CPU 使用率

javascript - 从 Parse 将媒体上传到 AWS

ssl - 忽略 Grunt 中无效的自签名 ssl 证书警告

gruntjs - Grunt (Yeoman, Grunt-usemin, Grunt-rev) : The "rev' ed"font path isn't reflected in my . CSS?

javascript - 如何在 grunt 插件中运行其他已注册的 grunt 任务?

c - 从 GetAdaptersAddresses() 获取 IP_ADDRESS_STRING?

node.js - npm install 不会安装 devDependencies