Yeoman gifsicle error (and others) - yeoman

I'm getting the following error while trying to do yo angular:
There are other error messages as well, during scaffolding.
I did:
npm install -g yo
npm install -g generator-angular
yo angular
I also tried doing npm install after it failed.
I also tried using yo webapp.
Here is the error:
> optipng-bin#0.3.1 postinstall C:\Users\SR71042\Documents\yeoman-app\node_modul
es\grunt-contrib-imagemin\node_modules\optipng-bin
> node lib/check.js
events.js:72
throw er; // Unhandled 'error' event
^
Error: getaddrinfo ENOTFOUND
at errnoException (dns.js:37:11)
at Object.onanswer [as oncomplete] (dns.js:124:16)
> jpegtran-bin#0.2.3 postinstall C:\Users\SR71042\Documents\yeoman-app\node_modu
les\grunt-contrib-imagemin\node_modules\jpegtran-bin
> node lib/check.js
module.js:340
throw err;
^
Error: Cannot find module 'chalk'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (C:\Users\SR71042\Documents\yeoman-app\node_modules\gr
unt-contrib-imagemin\node_modules\jpegtran-bin\lib\check.js:4:13)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
> gifsicle#0.1.4 postinstall C:\Users\SR71042\Documents\yeoman-app\node_modules\
grunt-contrib-imagemin\node_modules\gifsicle
> node lib/check.js
module.js:340
throw err;
^
Error: Cannot find module 'C:\Users\SR71042\Documents\yeoman-app\node_modules\gr
unt-contrib-imagemin\node_modules\gifsicle\lib\check.js'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:902:3
npm ERR! EEXIST, mkdir 'C:\Users\SR71042\Documents\yeoman-app\node_modules\grunt
-contrib-imagemin\node_modules\pngquant-bin\node_modules\bin-wrapper\node_module
s\mout\src\string'
File exists: C:\Users\SR71042\Documents\yeoman-app\node_modules\grunt-contrib-im
agemin\node_modules\pngquant-bin\node_modules\bin-wrapper\node_modules\mout\src\
string
Move it away, and try again.
npm ERR! System Windows_NT 6.1.7601
npm ERR! command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nod
ejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! cwd C:\Users\SR71042\Documents\yeoman-app
npm ERR! node -v v0.10.25
npm ERR! npm -v 1.3.24
npm ERR! path C:\Users\SR71042\Documents\yeoman-app\node_modules\grunt-contrib-i
magemin\node_modules\pngquant-bin\node_modules\bin-wrapper\node_modules\mout\src
\string
npm ERR! fstream_path C:\Users\SR71042\Documents\yeoman-app\node_modules\grunt-c
ontrib-imagemin\node_modules\pngquant-bin\node_modules\bin-wrapper\node_modules\
mout\src\string\repeat.js
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code EEXIST
npm ERR! errno 47
npm ERR! fstream_stack C:\Program Files\nodejs\node_modules\npm\node_modules\fst
ream\lib\writer.js:171:23
npm ERR! fstream_stack C:\Program Files\nodejs\node_modules\npm\node_modules\mkd
irp\index.js:37:53
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
npm ERR! error rolling back Error: EPERM, rmdir 'C:\Users\SR71042\Documents\yeom
an-app\node_modules\grunt-contrib-imagemin\node_modules\gifsicle\node_modules\bi
n-wrapper\node_modules\download\node_modules\request\node_modules\form-data\node
_modules\combined-stream'
npm ERR! error rolling back gifsicle#0.1.4 { [Error: EPERM, rmdir 'C:\Users\SR7
1042\Documents\yeoman-app\node_modules\grunt-contrib-imagemin\node_modules\gifsi
cle\node_modules\bin-wrapper\node_modules\download\node_modules\request\node_mod
ules\form-data\node_modules\combined-stream']
npm ERR! error rolling back errno: 50,
npm ERR! error rolling back code: 'EPERM',
npm ERR! error rolling back path: 'C:\\Users\\SR71042\\Documents\\yeoman-app\\
node_modules\\grunt-contrib-imagemin\\node_modules\\gifsicle\\node_modules\\bin-
wrapper\\node_modules\\download\\node_modules\\request\\node_modules\\form-data\
\node_modules\\combined-stream' }
npm ERR! error rolling back Error: EPERM, rmdir 'C:\Users\SR71042\Documents\yeom
an-app\node_modules\grunt-contrib-imagemin\node_modules\jpegtran-bin\node_module
s\bin-wrapper\node_modules\download\node_modules\request\node_modules\form-data\
node_modules\combined-stream'
npm ERR! error rolling back grunt-contrib-imagemin#0.3.0 { [Error: EPERM, rmdir
'C:\Users\SR71042\Documents\yeoman-app\node_modules\grunt-contrib-imagemin\node
_modules\jpegtran-bin\node_modules\bin-wrapper\node_modules\download\node_module
s\request\node_modules\form-data\node_modules\combined-stream']
npm ERR! error rolling back errno: 50,
npm ERR! error rolling back code: 'EPERM',
npm ERR! error rolling back path: 'C:\\Users\\SR71042\\Documents\\yeoman-app\\
node_modules\\grunt-contrib-imagemin\\node_modules\\jpegtran-bin\\node_modules\\
bin-wrapper\\node_modules\\download\\node_modules\\request\\node_modules\\form-d
ata\\node_modules\\combined-stream' }
npm ERR! optipng-bin#0.3.1 postinstall: `node lib/check.js`
npm ERR! Exit status 8
npm ERR!
npm ERR! Failed at the optipng-bin#0.3.1 postinstall script.
npm ERR! This is most likely a problem with the optipng-bin package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node lib/check.js
npm ERR! You can get their info via:
npm ERR! npm owner ls optipng-bin
npm ERR! There is likely additional logging output above.
npm ERR! System Windows_NT 6.1.7601
npm ERR! command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nod
ejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! cwd C:\Users\SR71042\Documents\yeoman-app
npm ERR! node -v v0.10.25
npm ERR! npm -v 1.3.24
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! C:\Users\SR71042\Documents\yeoman-app\npm-debug.log
npm ERR! not ok code 0
C:\Users\SR71042\Documents\yeoman-app>
Anyone has any ideas?

It maybe grunt-contrib-imagemin version ~0.8 has some errors.
Change your dependencies grunt-contrib-imageim to 0.7.1 in package.json
It will solve this problem

I have the same problem and I have resolve it with edit my package.json file.
In the devDependencies, I have upgrade the version of jpegtran-bin 0.2.0 to 0.2.6.
After that, I have launch npm install and now it's OK.
I hope that will help you to solve your problem.

If you get an error like "cannot find module 'imagemin-gifsicle'" then you might need to modify the dev dependencies of "grunt-contrib-imagemin" as "^0.7.1" in package.json. Then run "npm install".
This solved the error for me.

Try running npm install -g npm#2

Related

When installing Yarn with the command npm install -g yarn, I get a bug

npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules
npm ERR! code EACCES
npm ERR! syscall access
npm ERR! path /usr/local/lib/node_modules
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, access '/usr/local/lib/node_modules'
npm ERR! { [Error: EACCES: permission denied, access '/usr/local/lib/node_modules']
npm ERR! stack:
npm ERR! 'Error: EACCES: permission denied, access \'/usr/local/lib/node_modules\'',
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'access',
npm ERR! path: '/usr/local/lib/node_modules' }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/andybod/.npm/_logs/2021-11-01T08_46_14_576Z-debug.log
You tried to write to the folder where your user doesn't have such permissions (/usr)
Just use sudo for this purpose
sudo npm install -g yarn

Error Install Bower

I'm Wira and I'm a newbie
So recently i tried to install bower on my laptop and there are some errors like this:
C:\Users\wiraxie>npm install g- bower
npm ERR! Windows_NT 10.0.10240
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodej
node_modules\\npm\\bin\\npm-cli.js" "install" "g-" "bower"
npm ERR! node v4.4.7
npm ERR! npm v2.15.8
npm ERR! code EACCES
npm ERR! errno EACCES
npm ERR! syscall connect
npm ERR! Error: connect EACCES 151.101.76.162:443
npm ERR! at Object.exports._errnoException (util.js:873:11)
npm ERR! at exports._exceptionWithHostPort (util.js:896:20)
npm ERR! at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1077:14)
npm ERR! { [Error: connect EACCES 151.101.76.162:443]
npm ERR! code: 'EACCES',
npm ERR! errno: 'EACCES',
npm ERR! syscall: 'connect',
npm ERR! address: '151.101.76.162',
npm ERR! port: 443 }
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\wiraxie\npm-debug.log
Can Anyone help me?
Thanks in advance :)
Install bower with
npm install -g bower
and make sure your run the Command Prompt as an Administrator

Unable to install Plugman in iOS

I want to install Plugman in iOS for managing the Phonegap plugins. I am using the below command in Terminal.
npm install -g plugman
But I am getting the below error,
npm ERR! Error: EACCES, open '/Users/gtmac/.npm/npm/1.3.4/package/package.json'
npm ERR! { [Error: EACCES, open '/Users/gtmac/.npm/npm/1.3.4/package/package.json']
npm ERR! errno: 3,
npm ERR! code: 'EACCES',
npm ERR! path: '/Users/gtmac/.npm/npm/1.3.4/package/package.json',
npm ERR! parent: 'plugman' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! System Darwin 14.3.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "-g" "plugman"
npm ERR! cwd /Users/gtmac/Documents/Sinu/Insightix
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.14
npm ERR! path /Users/gtmac/.npm/npm/1.3.4/package/package.json
npm ERR! code EACCES
npm ERR! errno 3
npm ERR! stack Error: EACCES, open '/Users/gtmac/.npm/npm/1.3.4/package/package.json'
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /Users/gtmac/Documents/Sinu/Insightix/npm-debug.log
npm ERR! not ok code 0
I solved the issue by running the command after executing 'sudo -s'
$ sudo -s
$ npm install -g plugman

Trouble with installing Bower

I am trying to install Bower. Need Bower to install zurb Foundation. I am a newbie in this, a UX designer learning the frontend.
npm install - g bower
npm ERR! Error: not_found document not found: -
npm ERR! at RegClient.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:308:14)
npm ERR! at Request._callback (/usr/local/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:246:65)
npm ERR! at Request.self.callback (/usr/local/lib/node_modules/npm/node_modules/request/request.js:236:22)
npm ERR! at Request.emit (events.js:98:17)
npm ERR! at Request.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/request/request.js:1142:14)
npm ERR! at Request.emit (events.js:117:20)
npm ERR! at IncomingMessage.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/request/request.js:1096:12)
npm ERR! at IncomingMessage.emit (events.js:117:20)
npm ERR! at _stream_readable.js:944:16
npm ERR! at process._tickCallback (node.js:442:13)
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR! <http://github.com/npm/npm/issues>
npm ERR! System Darwin 12.6.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "-" "g" "bower"
npm ERR! cwd /Users/anandka
npm ERR! node -v v0.10.35
npm ERR! npm -v 1.4.28
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /Users/anandka/npm-debug.log
npm ERR! not ok code 0
Thanks in advance :)
You have a typo, you must remove the space before the g option.
npm is not finding package -, so:
npm install -g bower

how to resolve the cordova installation issue

I am trying to create cordova using the terminal but I am getting following error.
So far I know this is the only user account which we had created and intact should
be the root account
install -g cordova
npm http GET https://registry.npmjs.org/cordova
npm http 304 https://registry.npmjs.org/cordova
npm ERR! Error: EACCES, mkdir '/usr/local/lib/node_modules/cordova'
npm ERR! { [Error: EACCES, mkdir '/usr/local/lib/node_modules/cordova']
npm ERR! errno: 3,
npm ERR! code: 'EACCES',
npm ERR! path: '/usr/local/lib/node_modules/cordova',
npm ERR! fstream_type: 'Directory',
npm ERR! fstream_path: '/usr/local/lib/node_modules/cordova',
npm ERR! fstream_class: 'DirWriter',
npm ERR! fstream_stack:
npm ERR! [ '/usr/local/lib/node_modules/npm/node_modules/fstream/lib/dir-writer.js:36:23',
npm ERR! '/usr/local/lib/node_modules/npm/node_modules/mkdirp/index.js:37:53',
npm ERR! 'Object.oncomplete (fs.js:107:15)' ] }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! System Darwin 12.5.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "-g" "cordova"
npm ERR! cwd /Users/anantmac
npm ERR! node -v v0.10.26
npm ERR! npm -v 1.4.3
npm ERR! path /usr/local/lib/node_modules/cordova
npm ERR! fstream_path /usr/local/lib/node_modules/cordova
npm ERR! fstream_type Directory
npm ERR! fstream_class DirWriter
npm ERR! code EACCES
npm ERR! errno 3
npm ERR! stack Error: EACCES, mkdir '/usr/local/lib/node_modules/cordova'
npm ERR! fstream_stack /usr/local/lib/node_modules/npm/node_modules/fstream/lib/dir-writer.js:36:23
npm ERR! fstream_stack /usr/local/lib/node_modules/npm/node_modules/mkdirp/index.js:37:53
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /Users/anantmac/npm-debug.log
npm ERR! not ok code 0
Anants-MacBook-Air:~ anantmac$
Sometimes when installing node packages you need to use sudo so everything can write to the paths required, try this:
sudo npm install -g cordova

Resources