gpt4 book ai didi

node.js - 如何解决安装 grunt-contrib-uglify 的错误

转载 作者:太空宇宙 更新时间:2023-11-03 23:41:02 25 4
gpt4 key购买 nike

我试图安装模块 grunt-contrib-uglify 并最终出现以下错误:

[james@linux tmp]npm install grunt-contrib-uglify --save-dev
npm WARN package.json example-project@0.1.0 No description
npm WARN package.json example-project@0.1.0 No repository field.
npm WARN package.json example-project@0.1.0 No README data
npm http GET https://registry.npmjs.org/grunt-contrib-uglify
npm http 200 https://registry.npmjs.org/grunt-contrib-uglify
npm http GET https://registry.npmjs.org/grunt-contrib-uglify/-/grunt-contrib-uglify-0.4.0.tgz
npm http 200 https://registry.npmjs.org/grunt-contrib-uglify/-/grunt-contrib-uglify-0.4.0.tgz
npm http GET https://registry.npmjs.org/uglify-js
npm http GET https://registry.npmjs.org/maxmin
npm http GET https://registry.npmjs.org/chalk
npm http 304 https://registry.npmjs.org/chalk
npm ERR! Error: No compatible version found: chalk@'^0.4.0'
npm ERR! Valid install targets:
npm ERR! ["0.1.0","0.1.1","0.2.0","0.2.1","0.3.0","0.4.0"]
npm ERR! at installTargetsError (/usr/local/lib/node_modules/npm/lib/cache.js:719:10)
npm ERR! at /usr/local/lib/node_modules/npm/lib/cache.js:638:10
npm ERR! at saved (/usr/local/lib/node_modules/npm/node_modules/npm-registry-client/lib/get.js:142:7)
npm ERR! at /usr/local/lib/node_modules/npm/node_modules/graceful-fs/polyfills.js:133: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 2.6.32-358.el6.x86_64
npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "install" "grunt-contrib-uglify" "--save-dev"
npm ERR! cwd /export/home/james/tmp
npm ERR! node -v v0.10.15
npm ERR! npm -v 1.3.5
npm http 200 https://registry.npmjs.org/uglify-js
npm http 200 https://registry.npmjs.org/maxmin
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /export/home/james/tmp/npm-debug.log
npm ERR! not ok code 0

有什么线索吗?

最佳答案

尝试如下:

 1) npm install -g grunt-cli

这会将 grunt 命令放入您的系统路径中,允许它从任何目录运行。

请注意,安装 grunt-cli 不会安装 Grunt 任务运行程序! Grunt CLI 的工作很简单:运行已安装在 Gruntfile 旁边的 Grunt 版本。这允许在同一台机器上同时安装多个版本的 Grunt。

 2) npm install grunt --save-dev 

将 Grunt 和 gruntplugins 添加到现有 package.json 的最简单方法是使用命令 npm install --save-dev。这不仅会在本地安装,还会使用波浪号版本范围自动添加到 devDependencies 部分。

如需进一步帮助,请点击此链接

http://gruntjs.com/getting-started

关于node.js - 如何解决安装 grunt-contrib-uglify 的错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23806083/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com