当我尝试使用命令在 bash 中安装 gulp-imagemin 时,npm install gulp-imagemin --save-dev
会出现很多错误,如下所示。这是我第一次使用 gulp(或构建工具)。我已经安装了几个其他插件并且运行良好。这是我看到的第一个错误。我正在运行 Windows Vista。先感谢您。
Dimitris (master) performance-optimization $ npm install --save-dev gulp-imagem
in
-
> gifsicle@3.0.3 postinstall c:\Users\Dimitris\documents\nanodegree\performance-
optimization\node_modules\gulp-imagemin\node_modules\imagemin\node_modules\image
min-gifsicle\node_modules\gifsicle
> node lib/install.js
module.js:338
throw err;
^
Error: Cannot find module 'is-extglob'
at Function.Module._resolveFilename (module.js:336:15)
at Function.Module._load (module.js:278:25)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at Object.<anonymous> (c:\Users\Dimitris\documents\nanodegree\performance-op
timization\node_modules\gulp-imagemin\node_modules\imagemin\node_modules\vinyl-f
s\node_modules\glob-stream\node_modules\glob-parent\node_modules\is-glob\index.j
s:8:17)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Module.require (module.js:365:17)
at require (module.js:384:17)
> optipng-bin@3.0.4 postinstall c:\Users\Dimitris\documents\nanodegree\performan
ce-optimization\node_modules\gulp-imagemin\node_modules\imagemin\node_modules\im
agemin-optipng\node_modules\optipng-bin
> node lib/install.js
module.js:338
throw err;
^
Error: Cannot find module 'is-extglob'
at Function.Module._resolveFilename (module.js:336:15)
at Function.Module._load (module.js:278:25)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at Object.<anonymous> (c:\Users\Dimitris\documents\nanodegree\performance-op
timization\node_modules\gulp-imagemin\node_modules\imagemin\node_modules\vinyl-f
s\node_modules\glob-stream\node_modules\glob-parent\node_modules\is-glob\index.j
s:8:17)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Module.require (module.js:365:17)
at require (module.js:384:17)
npm WARN optional dep failed, continuing imagemin-gifsicle@4.2.0
> jpegtran-bin@3.0.6 postinstall c:\Users\Dimitris\documents\nanodegree\performa
nce-optimization\node_modules\gulp-imagemin\node_modules\imagemin\node_modules\i
magemin-jpegtran\node_modules\jpegtran-bin
> node lib/install.js
module.js:338
throw err;
^
Error: Cannot find module 'is-extglob'
at Function.Module._resolveFilename (module.js:336:15)
at Function.Module._load (module.js:278:25)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at Object.<anonymous> (c:\Users\Dimitris\documents\nanodegree\performance-op
timization\node_modules\gulp-imagemin\node_modules\imagemin\node_modules\vinyl-f
s\node_modules\glob-stream\node_modules\glob-parent\node_modules\is-glob\index.j
s:8:17)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Module.require (module.js:365:17)
at require (module.js:384:17)
npm WARN optional dep failed, continuing imagemin-optipng@4.3.0
npm WARN optional dep failed, continuing imagemin-jpegtran@4.3.2
npm ERR! Windows_NT 6.0.6002
npm ERR! argv "c:\\Program Files\\nodejs\\node.exe" "c:\\Program Files\\nodejs\\
node_modules\\npm\\bin\\npm-cli.js" "install" "--save-dev" "gulp-imagemin"
npm ERR! node v0.12.7
npm ERR! npm v2.11.3
npm ERR! path C:\Users\Dimitris\AppData\Roaming\npm-cache\is-extglob\1.0.0\packa
ge\package.json
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! Error: EPERM, rename 'C:\Users\Dimitris\AppData\Roaming\npm-cache\is-ex
tglob\1.0.0\package\package.json'
npm ERR! at Error (native)
npm ERR! { [Error: EPERM, rename 'C:\Users\Dimitris\AppData\Roaming\npm-cache\i
s-extglob\1.0.0\package\package.json']
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! path: 'C:\\Users\\Dimitris\\AppData\\Roaming\\npm-cache\\is-extglob\\
1.0.0\\package\\package.json',
npm ERR! parent: 'is-glob' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! Please include the following file with any support request:
npm ERR! c:\Users\Dimitris\documents\nanodegree\performance-optimization\npm
-debug.log
/c/Program Files/nodejs/npm: line 14: 7708 Signal 112 (core dumped
) "$basedir/node.exe" "$basedir/node_modules/npm/bin/npm-cli.js" "$@"