我只是想在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'
答案 0 :(得分:0)
试试这个:npm install grunt-contrib-uglify --save-dev ...它会将最新版本下载到你的电脑并将版本保存到你的package.json 在github上有uglify的文档
答案 1 :(得分:0)
您指定需要:
grunt-contrib-nodeunit
版本为~0.6.3,但latest version available仅为0.2.2 grunt-contrib-uglify
版本为~0.6.3,但latest version available仅为0.2.7 您应该修复package.json
版本信息。