首页 > 解决方案 > 无法在节点 0.10.x 中安装开发依赖项错误:未找到兼容版本:

问题描述

我正在尝试运行一个旧节点项目,节点版本为“0.10.x”,npm 版本为“1.4.x”。我创建了一个节点版本为 0.10.9 和 npm 版本为 1.2.24 的 nodeenv

该项目的开发依赖项为 "load-grunt-tasks": "~0.6.0".

但是当我尝试使用 npm install 时npm install load-grunt-tasks@~0.6.0,我收到以下错误:

npm ERR! Error: No compatible version found: multimatch@'^0.3.0'
npm ERR! Valid install targets:
npm ERR! ["0.1.0","0.2.0","0.3.0","1.0.0","1.0.1","2.0.0","2.1.0","3.0.0","4.0.0","5.0.0"]
npm ERR!     at installTargetsError (/mnt/c/Users/harsh/OneDrive/Documents/ONITO/software-services/hcare/OphthalmoCare-development/env-0.10/lib/node_modules/npm/lib/cache.js:709:10)
npm ERR!     at /mnt/c/Users/harsh/OneDrive/Documents/ONITO/software-services/hcare/OphthalmoCare-development/env-0.10/lib/node_modules/npm/lib/cache.js:631:10
npm ERR!     at saved (/mnt/c/Users/harsh/OneDrive/Documents/ONITO/software-services/hcare/OphthalmoCare-development/env-0.10/lib/node_modules/npm/node_modules/npm-registry-client/lib/get.js:138: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 Linux 4.4.0-19041-Microsoft
npm ERR! command "/mnt/c/Users/harsh/OneDrive/Documents/ONITO/software-services/hcare/OphthalmoCare-development/env-0.10/bin/node" "/mnt/c/Users/harsh/OneDrive/Documents/ONITO/software-services/hcare/OphthalmoCare-development/env-0.10/bin/npm" "install" "load-grunt-tasks@~0.6.0"
npm ERR! cwd /mnt/c/Users/harsh/OneDrive/Documents/ONITO/software-services/hcare/OphthalmoCare-development
npm ERR! node -v v0.10.9
npm ERR! npm -v 1.2.24
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     /mnt/c/Users/harsh/OneDrive/Documents/ONITO/software-services/hcare/OphthalmoCare-development/npm-debug.log
npm ERR! not ok code 0

或者有时依赖错误被替换为

npm ERR! Error: No compatible version found: findup-sync@'^0.1.2'
npm ERR! Valid install targets:
npm ERR! ["0.1.0","0.1.1","0.1.2","0.1.3","0.2.0","0.2.1","0.3.0","0.4.0","0.4.1","0.4.2","0.4.3","1.0.0","2.0.0","3.0.0","4.0.0"]

标签: node.jsnpmnode-modulesnpm-installpackage.json

解决方案


0.6.0 版本已经load-grunt-tasks7 年了,所以还是建议升级一下。

有趣/奇怪的是,它认为没有兼容的版本,尽管它确实给出了一个版本列表,包括一个应该兼容的版本。由于使用了像 1.2.24 这样的旧 NPM 版本,可能是一个错误,因为这似乎之前已经报告过了。


推荐阅读