0

我无法在我的 Windows 8.1 机器上安装 grunt-contrib-imagemin。

我有节点版本 0.10.33。我有 npm 版本 1.4.28。它们都是全新的安装。

我按照本教程设置 Grunt 来管理 Laravel 项目中的 SASS、JS 和图像。

我安装了 grunt-contrib-sass,grunt-contrib-uglify 很好,然后继续尝试使用官方 GitHub 页面上的以下命令安装 grunt-contrib-imagemin:

npm install grunt-contrib-imagemin --save-dev

它给了我一个奇怪的警告:

npm WARN package.json Rent@0.1.0 No repository field.
npm WARN engine imagemin@2.2.1: wanted: {"node":">=0.10.0","npm":">=2.1.5"} (current: {"node":"0.10.33","npm":"1.4.28"})

所以我想也许我的 npm 已经过时了,所以我卸载并重新安装了很多次。

然后我决定离开它看看它是否仍然有效,不管错误如何,然后发生这种情况:

npm WARN engine imagemin@2.2.1: wanted: {"node":">=0.10.0","npm":">=2.1.5"} (current: {"node":"0.10.33","npm":"1.4.28"})
npm WARN optional dep failed, continuing imagemin-jpegtran@4.0.0
npm WARN optional dep failed, continuing imagemin-gifsicle@4.0.0
npm WARN optional dep failed, continuing imagemin-optipng@4.0.0
npm WARN optional dep failed, continuing imagemin-pngquant@4.0.0
npm ERR! EEXIST, open 'C:\Users\Daniel\AppData\Roaming\npm-cache\f0f75a32-m-cache-lodash-2-4-1-package-tgz.lock'
File exists: C:\Users\Daniel\AppData\Roaming\npm-cache\f0f75a32-m-cache-lodash-2-4-1-package-tgz.lock
Move it away, and try again.

npm ERR! System Windows_NT 6.2.9200
npm ERR! command "C:\\Program Files (x86)\\nodejs\\\\node.exe" "C:\\Program Files (x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "instal
l"
npm ERR! cwd C:\xampp\htdocs\rent1
npm ERR! node -v v0.10.33
npm ERR! npm -v 1.4.28
npm ERR! path C:\Users\Daniel\AppData\Roaming\npm-cache\f0f75a32-m-cache-lodash-2-4-1-package-tgz.lock
npm ERR! code EEXIST
npm ERR! errno 47
npm ERR! not ok code 0

我不知道为什么我不能安装它。我在工作时在我的 Windows 7 机器上进行了尝试,它在安装相同的 Node 和 NPM 时运行良好。

4

1 回答 1

0

将 npm 升级到最新版本。

那里修复了很多错误。

由于竞争条件,它在不同的机器上是不同的。速度会有所不同。

于 2014-11-06T17:44:20.347 回答