node.js - 运行 npm install 时出错 : No compatible version found: async

标签 node.js asynchronous npm

我在 package.json 中添加了 caolan/async 作为

"async": "~0.9.0",

async 的 npmjs 页面在其网站上写着“0.9.0 7个月前由 caolan 发布”。当我使用 npm install 安装时出现错误

npm ERR! notarget No compatible version found: async@'>=0.9.2-0 <0.10.0-0'
npm ERR! notarget Valid install targets:
npm ERR! notarget ["0.1.0","0.1.1","0.1.2","0.1.3","0.1.4","0.1.5","0.1.6","0.1.7","0.1.8","0.1.9","0.1.10","0.1.11","0.1.12","0.1.13","0.1.14","0.1.15","0.1.16","0.1.17","0.1.18","0.1.19","0.1.20","0.1.21","0.1.22","0.2.0","0.2.1","0.2.2","0.2.3","0.2.4","0.2.5","0.2.6","0.2.7","0.2.8","0.2.9","0.2.10","0.3.0","0.4.0","0.4.1","0.5.0","0.6.0","0.6.1","0.6.2","0.7.0","0.8.0","0.9.0"]
npm ERR! notarget 
npm ERR! notarget This is most likely not a problem with npm itself.
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.

npm ERR! System Linux 3.13.0-36-generic
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install"
npm ERR! cwd /home/ubuntu/pickingo/pickingo
npm ERR! node -v v0.10.35
npm ERR! npm -v 1.4.28
npm ERR! code ETARGET
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /home/ubuntu/pickingo/pickingo/npm-debug.log
npm ERR! not ok code 0

如何修复错误?

最佳答案

要修复该错误,您应该更新您的 npm 版本。 npm@1.4.28 不理解版本中的 ~ 运算符。

sudo npm install -g npm@latest

之后,您应该拥有 npm 2.1.16(或更高版本),并且您的 npm install 应该会成功。

关于node.js - 运行 npm install 时出错 : No compatible version found: async,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27680713/

相关文章:

Javascript同步加载表文件

git - npm scripts/package.json - 只有当前在 git master 分支上时才运行

javascript - 使用 handlebars.js 循环对象的对象

javascript - 使用ajax提交表单时出现错误

node.js - 错误无法确定 Node.js 安装目录

node.js - 即使 prettier 在 devDependancies 中,prettier 命令也不起作用

node.js - 使用 html-pdf Node 模块在标题中添加图像

javascript - 速率限制注册 API

javascript - 避免并行异步任务中的冗余

ios - 如何同时执行多个异步方法并在它们全部完成时获得回调?