npm 不安装下划线包 [英] npm not install underscore packages

查看:104
本文介绍了npm 不安装下划线包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想用 npm 安装软件包:我的包文件是:

I want to install packages with npm: my packages file is:

  "dependencies": {
    "express": "~3.3.6",
    "socket.io": "0.9.16",
    "jade": "~0.35.0",
    "less-middleware": "~0.1.12",
    "redis": "~0.8.4",
    "connect-redis": "~1.4.5",
    "longjohn": "~0.2.1",
    "mongoose": "~3.6.20",
    "json-stringify-safe": "~5.0.0"
  },
  "devDependencies": {
    "grunt": "~0.4.1",
    "grunt-contrib-uglify": "~0.2.2",
    "grunt-nodemon": "~0.1.0",
    "grunt-contrib-jshint": "~0.6.3",
    "grunt-contrib-less": "~0.7.0",
    "grunt-ngmin": "0.0.3"
  }
}

但我有这个错误:

npm http 304 https://registry.npmjs.org/underscore.string
npm ERR! Error: No compatible version found: underscore.string@'~2.2.0rc'
npm ERR! Valid install targets:
npm ERR! ["0.9.2","1.0.0","1.1.3","1.1.4","1.1.5","1.1.6","2.0.0","2.1.0","2.1.1","2.3.0","2.3.1","2.3.2","2.2.1","2.2.0-rc","2.3.3"]
npm ERR!     at installTargetsError (/usr/share/npm/lib/cache.js:685:10)
npm ERR!     at /usr/share/npm/lib/cache.js:607:10
npm ERR!     at saved (/usr/share/npm/node_modules/npm-registry-client/lib/get.js:138:7)
npm ERR!     at /usr/lib/nodejs/graceful-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://bugs.debian.org/npm>
npm ERR! or use
npm ERR!     reportbug --attach /home/vahid/Workspace/talkie/npm-debug.log npm

npm ERR! System Linux 3.11.0-12-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install"
npm ERR! cwd /home/vahid/Workspace/talkie
npm ERR! node -v v0.10.15
npm ERR! npm -v 1.2.18

我该如何解决这个错误?谢谢!

how i can fix this error? thanks!

推荐答案

如果您有尚未应用的 Grunt 版本 this 补丁,那么您将由于 package.json 中的这一行输入错误而得到该错误:

If you have a Grunt version that has not yet applied this patch, then you will get that error due to a mistype where this line in the package.json:

underscore.string@'~2.2.0rc

应该是这样的:

underscore.string@'~2.2.0-rc

要解决此问题,请使用较新版本的 Grunt.

To fix this problem, use a newer version of Grunt.

这篇关于npm 不安装下划线包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆