Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error Installing Yeoman on ubuntu

Tags:

npm

ubuntu

yeoman

When i try to install Yeoman on ubuntu i am getting the following error.

enter image description here

harsha@harshamv:~$ sudo npm install yo -g
[sudo] password for harsha: 
npm http GET https://registry.npmjs.org/yo
npm http 304 https://registry.npmjs.org/yo
npm http GET https://registry.npmjs.org/nopt
npm http GET https://registry.npmjs.org/lodash
npm http GET https://registry.npmjs.org/update-notifier
npm http GET https://registry.npmjs.org/insight
npm http GET https://registry.npmjs.org/async
npm http GET https://registry.npmjs.org/sudo-block
npm http GET https://registry.npmjs.org/open/0.0.4
npm http GET https://registry.npmjs.org/chalk
npm http GET https://registry.npmjs.org/findup
npm http GET https://registry.npmjs.org/shelljs
npm http GET https://registry.npmjs.org/yeoman-generator
npm http 304 https://registry.npmjs.org/nopt
npm http 304 https://registry.npmjs.org/update-notifier
npm http 304 https://registry.npmjs.org/insight
npm http 304 https://registry.npmjs.org/lodash
npm http 304 https://registry.npmjs.org/open/0.0.4
npm http 304 https://registry.npmjs.org/findup
npm http 304 https://registry.npmjs.org/chalk
npm http 304 https://registry.npmjs.org/sudo-block
npm http 304 https://registry.npmjs.org/yeoman-generator
npm http 304 https://registry.npmjs.org/shelljs
npm http 304 https://registry.npmjs.org/async
npm http GET https://registry.npmjs.org/has-color
npm http GET https://registry.npmjs.org/ansi-styles
npm http GET https://registry.npmjs.org/strip-ansi
npm http GET https://registry.npmjs.org/semver
npm http GET https://registry.npmjs.org/request
npm http GET https://registry.npmjs.org/configstore
npm http GET https://registry.npmjs.org/inquirer
npm http GET https://registry.npmjs.org/abbrev
npm http GET https://registry.npmjs.org/ansi-styles
npm http GET https://github.com/Filirom1/nopt/tarball/master#pull-request-in-progress
npm http GET https://registry.npmjs.org/colors
npm http GET https://registry.npmjs.org/cheerio
npm http GET https://registry.npmjs.org/rimraf
npm http GET https://registry.npmjs.org/diff
npm http GET https://registry.npmjs.org/mime
npm http GET https://registry.npmjs.org/underscore.string
npm http GET https://registry.npmjs.org/mkdirp
npm http GET https://registry.npmjs.org/glob
npm http GET https://registry.npmjs.org/debug
npm http GET https://registry.npmjs.org/isbinaryfile
npm http GET https://registry.npmjs.org/dargs
npm http GET https://registry.npmjs.org/inquirer
npm http GET https://registry.npmjs.org/iconv-lite
npm http GET https://registry.npmjs.org/findup-sync
npm http GET https://registry.npmjs.org/text-table
npm http GET https://registry.npmjs.org/download
npm http GET https://registry.npmjs.org/file-utils
npm http GET https://registry.npmjs.org/request
npm http GET https://registry.npmjs.org/class-extend
npm http 304 https://registry.npmjs.org/has-color
npm http 304 https://registry.npmjs.org/semver
npm http 304 https://registry.npmjs.org/request
npm http 304 https://registry.npmjs.org/ansi-styles
npm http 304 https://registry.npmjs.org/strip-ansi
npm http 304 https://registry.npmjs.org/ansi-styles
npm http 304 https://registry.npmjs.org/abbrev
npm http 304 https://registry.npmjs.org/configstore
npm http 304 https://registry.npmjs.org/inquirer
npm http 304 https://registry.npmjs.org/colors
npm http GET https://registry.npmjs.org/osenv/0.0.3
npm http GET https://registry.npmjs.org/graceful-fs
npm http GET https://registry.npmjs.org/js-yaml
npm http 304 https://registry.npmjs.org/cheerio
npm http 304 https://registry.npmjs.org/mime
npm http 304 https://registry.npmjs.org/diff
npm http 304 https://registry.npmjs.org/underscore.string
npm http 304 https://registry.npmjs.org/rimraf
npm http GET https://registry.npmjs.org/cli-color
npm http GET https://registry.npmjs.org/mute-stream/0.0.3
npm http GET https://registry.npmjs.org/qs
npm http GET https://registry.npmjs.org/json-stringify-safe
npm http GET https://registry.npmjs.org/tunnel-agent
npm http GET https://registry.npmjs.org/forever-agent
npm http GET https://registry.npmjs.org/http-signature
npm http GET https://registry.npmjs.org/hawk
npm http GET https://registry.npmjs.org/aws-sign
npm http GET https://registry.npmjs.org/oauth-sign
npm http GET https://registry.npmjs.org/cookie-jar
npm http GET https://registry.npmjs.org/node-uuid
npm http GET https://registry.npmjs.org/form-data
npm http 304 https://registry.npmjs.org/mkdirp
npm http 304 https://registry.npmjs.org/glob
npm http 304 https://registry.npmjs.org/debug
npm http 304 https://registry.npmjs.org/isbinaryfile
npm http 304 https://registry.npmjs.org/dargs
npm http 304 https://registry.npmjs.org/findup-sync
npm http 304 https://registry.npmjs.org/inquirer
npm http 304 https://registry.npmjs.org/iconv-lite
npm http 304 https://registry.npmjs.org/text-table
npm http 304 https://registry.npmjs.org/download
npm http 304 https://registry.npmjs.org/file-utils
npm http 304 https://registry.npmjs.org/request
npm http 304 https://registry.npmjs.org/class-extend
npm http 304 https://registry.npmjs.org/graceful-fs
npm http 304 https://registry.npmjs.org/osenv/0.0.3
npm http GET https://registry.npmjs.org/decompress
npm http GET https://registry.npmjs.org/each-async
npm http GET https://registry.npmjs.org/through2
npm http 304 https://registry.npmjs.org/js-yaml
npm http 304 https://registry.npmjs.org/cli-color
npm http 304 https://registry.npmjs.org/mute-stream/0.0.3
npm http 304 https://registry.npmjs.org/qs
npm http 200 https://github.com/Filirom1/nopt/tarball/master#pull-request-in-progress
npm http 304 https://registry.npmjs.org/json-stringify-safe
npm http GET https://registry.npmjs.org/tough-cookie
npm http GET https://registry.npmjs.org/aws-sign2
npm http 304 https://registry.npmjs.org/http-signature
npm http 304 https://registry.npmjs.org/tunnel-agent
npm http 304 https://registry.npmjs.org/forever-agent
npm http 304 https://registry.npmjs.org/hawk
npm http GET https://registry.npmjs.org/through
npm http GET https://registry.npmjs.org/mute-stream/0.0.4
npm http GET https://registry.npmjs.org/inherits
npm http GET https://registry.npmjs.org/minimatch
npm http GET https://registry.npmjs.org/es5-ext
npm http GET https://registry.npmjs.org/memoizee
npm http 304 https://registry.npmjs.org/aws-sign
npm http GET https://registry.npmjs.org/inherits
npm http 304 https://registry.npmjs.org/cookie-jar
npm http 304 https://registry.npmjs.org/node-uuid
npm http 304 https://registry.npmjs.org/oauth-sign
npm http GET https://registry.npmjs.org/argparse
npm http GET https://registry.npmjs.org/esprima
npm http GET https://registry.npmjs.org/lodash
npm http GET https://registry.npmjs.org/minimatch
npm http 304 https://registry.npmjs.org/form-data
npm http 304 https://registry.npmjs.org/decompress
npm http 304 https://registry.npmjs.org/each-async
npm http 304 https://registry.npmjs.org/through2
npm http GET https://registry.npmjs.org/combined-stream
npm http 304 https://registry.npmjs.org/tough-cookie
npm http 304 https://registry.npmjs.org/aws-sign2
npm http 304 https://registry.npmjs.org/through
npm http 304 https://registry.npmjs.org/mute-stream/0.0.4
npm http GET https://registry.npmjs.org/tar
npm http GET https://registry.npmjs.org/stream-combiner
npm http GET https://registry.npmjs.org/tempfile
npm http GET https://registry.npmjs.org/adm-zip
npm http GET https://registry.npmjs.org/mout
npm http GET https://registry.npmjs.org/assert-plus/0.1.2
npm http GET https://registry.npmjs.org/asn1/0.1.11
npm http GET https://registry.npmjs.org/ctype/0.5.2
npm http 304 https://registry.npmjs.org/inherits
npm http 304 https://registry.npmjs.org/minimatch
npm http GET https://registry.npmjs.org/readable-stream
npm http GET https://registry.npmjs.org/xtend
npm http 304 https://registry.npmjs.org/es5-ext
npm http 304 https://registry.npmjs.org/memoizee
npm http 304 https://registry.npmjs.org/inherits
npm http 304 https://registry.npmjs.org/argparse
npm http 304 https://registry.npmjs.org/esprima
npm http 304 https://registry.npmjs.org/lodash
npm http 304 https://registry.npmjs.org/minimatch
npm http GET https://registry.npmjs.org/CSSselect
npm http GET https://registry.npmjs.org/entities
npm http 304 https://registry.npmjs.org/combined-stream
npm http GET https://registry.npmjs.org/underscore
npm http GET https://registry.npmjs.org/htmlparser2
npm http 304 https://registry.npmjs.org/tar
npm http GET https://registry.npmjs.org/lru-cache
npm http GET https://registry.npmjs.org/sigmund
npm http 304 https://registry.npmjs.org/stream-combiner
npm http 304 https://registry.npmjs.org/tempfile
npm http 304 https://registry.npmjs.org/mout
npm http 304 https://registry.npmjs.org/adm-zip
npm http 304 https://registry.npmjs.org/assert-plus/0.1.2
npm http GET https://registry.npmjs.org/sntp
npm http GET https://registry.npmjs.org/boom
npm http GET https://registry.npmjs.org/hoek
npm http GET https://registry.npmjs.org/cryptiles
npm http GET https://registry.npmjs.org/punycode
npm http GET https://registry.npmjs.org/uuid
npm http GET https://registry.npmjs.org/delayed-stream/0.0.5
npm http 304 https://registry.npmjs.org/ctype/0.5.2
npm http GET https://registry.npmjs.org/duplexer
npm http 304 https://registry.npmjs.org/asn1/0.1.11
npm http 304 https://registry.npmjs.org/readable-stream
npm http 304 https://registry.npmjs.org/xtend
npm http 304 https://registry.npmjs.org/CSSselect
npm http GET https://registry.npmjs.org/event-emitter
npm http GET https://registry.npmjs.org/next-tick
npm http GET https://registry.npmjs.org/underscore
npm http 304 https://registry.npmjs.org/entities
npm http 304 https://registry.npmjs.org/underscore
npm http GET https://registry.npmjs.org/object-keys
npm http 304 https://registry.npmjs.org/lru-cache
npm http 304 https://registry.npmjs.org/sigmund
npm http 304 https://registry.npmjs.org/htmlparser2
npm http 304 https://registry.npmjs.org/boom
npm http GET https://registry.npmjs.org/string_decoder
npm http 304 https://registry.npmjs.org/sntp
npm http GET https://registry.npmjs.org/fstream
npm http GET https://registry.npmjs.org/block-stream
npm http 304 https://registry.npmjs.org/punycode
npm http 304 https://registry.npmjs.org/hoek
npm http 304 https://registry.npmjs.org/cryptiles
npm WARN package.json [email protected] No README.md file found!
npm http 304 https://registry.npmjs.org/uuid
npm http 304 https://registry.npmjs.org/delayed-stream/0.0.5
npm http 304 https://registry.npmjs.org/duplexer
npm http 304 https://registry.npmjs.org/event-emitter
npm http 304 https://registry.npmjs.org/next-tick
npm http 304 https://registry.npmjs.org/object-keys
npm http 304 https://registry.npmjs.org/underscore
npm http 304 https://registry.npmjs.org/string_decoder
npm http 304 https://registry.npmjs.org/fstream
npm http GET https://registry.npmjs.org/domhandler
npm http GET https://registry.npmjs.org/domutils
npm http GET https://registry.npmjs.org/domelementtype
npm http GET https://registry.npmjs.org/CSSwhat
npm http 304 https://registry.npmjs.org/block-stream
npm http 304 https://registry.npmjs.org/domhandler
npm http 304 https://registry.npmjs.org/domutils
npm http 304 https://registry.npmjs.org/domelementtype
npm http 304 https://registry.npmjs.org/CSSwhat
npm http GET https://registry.npmjs.org/core-util-is
npm http GET https://registry.npmjs.org/debuglog/0.0.2
npm http 304 https://registry.npmjs.org/core-util-is
npm http 304 https://registry.npmjs.org/debuglog/0.0.2
/usr/local/bin/yo -> /usr/local/lib/node_modules/yo/cli.js

> [email protected] postinstall /usr/local/lib/node_modules/yo
> node ./scripts/doctor

sh: 1: node: not found
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian

npm ERR! [email protected] postinstall: `node ./scripts/doctor`
npm ERR! `sh "-c" "node ./scripts/doctor"` failed with 127
npm ERR! 
npm ERR! Failed at the [email protected] postinstall script.
npm ERR! This is most likely a problem with the yo package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node ./scripts/doctor
npm ERR! You can get their info via:
npm ERR!     npm owner ls yo
npm ERR! There is likely additional logging output above.

npm ERR! System Linux 3.11.0-15-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "yo" "-g"
npm ERR! cwd /home/harsha
npm ERR! node -v v0.10.15
npm ERR! npm -v 1.2.18
npm ERR! code ELIFECYCLE
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /home/harsha/npm-debug.log
npm ERR! not ok code 0

EDIT

After Trying MortezaLSC's solution -- i am getting the following error

npm http 304 https://registry.npmjs.org/amdefine
/usr/local/bin/bower -> /usr/local/lib/node_modules/bower/bin/bower
/usr/local/bin/yo -> /usr/local/lib/node_modules/yo/cli.js

> [email protected] postinstall /usr/local/lib/node_modules/yo
> node ./scripts/doctor

sh: 1: node: not found
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian

npm ERR! [email protected] postinstall: `node ./scripts/doctor`
npm ERR! `sh "-c" "node ./scripts/doctor"` failed with 127
npm ERR! 
npm ERR! Failed at the [email protected] postinstall script.
npm ERR! This is most likely a problem with the yo package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node ./scripts/doctor
npm ERR! You can get their info via:
npm ERR!     npm owner ls yo
npm ERR! There is likely additional logging output above.

npm ERR! System Linux 3.11.0-15-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "-g" "yo" "grunt-cli" "bower"
npm ERR! cwd /usr/local/share
npm ERR! node -v v0.10.15
npm ERR! npm -v 1.2.18
npm ERR! code ELIFECYCLE
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /usr/local/share/npm-debug.log
npm ERR! not ok code 0
like image 387
Harsha M V Avatar asked Nov 30 '22 19:11

Harsha M V


2 Answers

I ran into various problems like this on both Ubuntu 12.04 and CentOS 6. I was running the latest version of npm on both, but no luck - lots of errors.

After much Googling, apt-getting and yumming it finally hit me to upgrade node itself. See this answer on upgrading, i.e.:

sudo npm install n -g
sudo n stable

After that I went back to:

sudo npm install -g yo

and it installed just fine on both OSes!

Well, on CentOS I did also have to go to my home directory and do:

sudo chmod -R myusername .npm

(.npm and everything under it was owned by root, causing trouble when running yo generators).

like image 172
vulcan Avatar answered Dec 03 '22 08:12

vulcan


try this:

sudo apt-get install nodejs-legacy 
like image 39
Dipayan Avatar answered Dec 03 '22 09:12

Dipayan