我只是想在 Mac 上执行 sudo npm install ,具有以下依赖项:
"devDependencies": {
"grunt": "~0.4.2",
"grunt-contrib-jshint": "~0.6.3",
"grunt-contrib-nodeunit": "~0.6.3",
"grunt-contrib-uglify": "~0.6.3"
},
但 npm 一直告诉我:
npm ERR! notarget No compatible version found: grunt-contrib-uglify@'>=0.6.3-0 <0.7.0-0'
npm ERR! notarget Valid install targets:
npm ERR! notarget ["0.1.0","0.1.1","0.1.2","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.1.1-rc5","0.1.1-rc6"]
当我确定我想要的版本存在时,uglify 也会发生同样的事情,并且我在 Windows 上的朋友能够使用相同的 package.json 进行安装就好了
我担心我的版本,所以我安装了最新版本的 node 和 npm,然后运行 sudo npm update npm -g,没有解决问题
109 error node -v v0.10.22
110 error npm -v 1.3.15
111 error code ETARGET
112 verbose exit [ 1, true ]
以及来自调试日志的更多内容
97 silly addNameRange number 2 { name: 'grunt-contrib-uglify',
97 silly addNameRange range: '>=0.6.3-0 <0.7.0-0',
97 silly addNameRange hasData: true }
98 silly addNameRange versions [ 'grunt-contrib-uglify',
98 silly addNameRange [ '0.1.0',
98 silly addNameRange '0.1.1',
98 silly addNameRange '0.1.2',
98 silly addNameRange '0.2.0',
98 silly addNameRange '0.2.1',
98 silly addNameRange '0.2.2',
98 silly addNameRange '0.2.3',
98 silly addNameRange '0.2.4',
98 silly addNameRange '0.2.5',
98 silly addNameRange '0.2.6',
98 silly addNameRange '0.2.7',
98 silly addNameRange '0.1.1-rc5',
98 silly addNameRange '0.1.1-rc6' ] ]
99 silly lockFile 9c3f05fb-grunt-contrib-uglify-0-6-3 grunt-contrib-uglify@~0.6.3
100 silly lockFile 9c3f05fb-grunt-contrib-uglify-0-6-3 grunt-contrib-uglify@~0.6.3
101 silly addNameRange number 2 { name: 'grunt-contrib-nodeunit',
101 silly addNameRange range: '>=0.6.3-0 <0.7.0-0',
101 silly addNameRange hasData: true }
102 silly addNameRange versions [ 'grunt-contrib-nodeunit',
102 silly addNameRange [ '0.1.0',
102 silly addNameRange '0.1.1',
102 silly addNameRange '0.1.2',
102 silly addNameRange '0.2.0',
102 silly addNameRange '0.2.1',
102 silly addNameRange '0.2.2',
102 silly addNameRange '0.1.2-rc5',
102 silly addNameRange '0.1.2-rc6' ] ]
103 silly lockFile 77c5bd75-grunt-contrib-nodeunit-0-6-3 grunt-contrib-nodeunit@~0.6.3
104 silly lockFile 77c5bd75-grunt-contrib-nodeunit-0-6-3 grunt-contrib-nodeunit@~0.6.3
105 error notarget No compatible version found: grunt-contrib-uglify@'>=0.6.3-0 <0.7.0-0'