NPM报告"requires (one version)' but will load (another version)"



可能在用npm安装 cordove 后,我几乎每个 npm 操作都收到警告消息"需要 colors@'>=0.6.0' 但会加载......颜色">

D:WorkspacesEnide-Studio-2014OpenWith.js>npm i . -g
C:UsersweiblAppDataRoamingnpmopenwith -> C:UsersweiblAppDataRoamingnpmnode_modulesopenwithbinopenwith.js
npm WARN unmet dependency C:UsersweiblAppDataRoamingnpmnode_modulesphonegapnode_modulescordova requires colors@'>=0.6.0' but will load
npm WARN unmet dependency C:UsersweiblAppDataRoamingnpmnode_modulesphonegapnode_modulescolors,
npm WARN unmet dependency which is version 0.6.0-1
npm WARN unmet dependency C:UsersweiblAppDataRoamingnpmnode_modulesphonegapnode_modulesnode-static requires colors@'>=0.6.0' but will load
npm WARN unmet dependency C:UsersweiblAppDataRoamingnpmnode_modulesphonegapnode_modulescolors,
npm WARN unmet dependency which is version 0.6.0-1
openwith@0.11.0 C:UsersweiblAppDataRoamingnpmnode_modulesopenwith

如何修复此类 npm 错误?

正如安德鲁所暗示的那样,解决方案是

npm -g update colors

清理节点模块文件夹并重新运行: npm 安装

首先,删除位置C:UsersweiblAppDataRoamingnpmnode_modules中的phonegap文件夹。当然,具体位置对于其他人来说会有所不同。

然后,继续执行所需的任何npm安装/更新命令。

相关内容

最新更新