yo icon indicating copy to clipboard operation
yo copied to clipboard

Errors when installing

Open sarath2 opened this issue 12 years ago • 16 comments

run: sudo npm install -g yo

/usr/local/bin/yo -> /usr/local/lib/node_modules/yo/cli.js

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

module.js:340 throw err; ^ Error: Cannot find module '/usr/local/lib/node_modules/yo/scripts/doctor.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:901:3 npm ERR! weird error 8 npm ERR! not ok code 0

sarath2 avatar Dec 30 '13 07:12 sarath2

Run npm uninstall -g yo && npm cache clean && npm i -g yo

SBoudrias avatar Dec 30 '13 07:12 SBoudrias

Great! [Yeoman Doctor] Everything looks allright!

sarath2 avatar Dec 30 '13 07:12 sarath2

I tried step mentioned above but still getting the same error.

/root/npm/bin/yo -> /root/npm/lib/node_modules/yo/cli.js

[email protected] postinstall /root/npm/lib/node_modules/yo node ./scripts/doctor

module.js:340 throw err; ^ Error: Cannot find module '/root/npm/lib/node_modules/yo/scripts/doctor' 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! [email protected] postinstall: node ./scripts/doctor npm ERR! Exit status 8 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-12-generic npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install" "-g" "yo" npm ERR! cwd /root npm ERR! node -v v0.10.24 npm ERR! npm -v 1.3.21 npm ERR! code ELIFECYCLE npm ERR! npm ERR! Additional logging details can be found in: npm ERR! /root/npm-debug.log npm ERR! not ok code 0

geekf avatar Jan 22 '14 14:01 geekf

npm install yo works... npm install -g yo fails...

geekf avatar Jan 22 '14 14:01 geekf

Somehow this file haven't been downloaded: '/root/npm/lib/node_modules/yo/scripts/doctor'

Make sure your fetching from the real NPM repo.

SBoudrias avatar Jan 22 '14 15:01 SBoudrias

The installation is working perfectly fine on my windows system (using nodejs for windows and git bash), but failing on my Ubuntu VM (12.10).

The calls are going to https://registry.npmjs.org/yo which I think should be correct.

Not sure what the exact issue is; but any lead to debug the issue would be much appreciated.

geekf avatar Jan 22 '14 18:01 geekf

@SBoudrias: I figured out the issue in my case. I was logged into my Ubuntu VM as root, and seems like that does not work. Logged in as ordinary account and it worked. Thanks.

geekf avatar Feb 18 '14 12:02 geekf

I have this same issue in Ubuntu 13.10. Like @geekf I can install it locally but not globally. Can this be related with my actual Node installation?

bismark64 avatar Mar 08 '14 22:03 bismark64

Any ideas how to resolve this error ?

module.js:340 throw err; ^ Error: Cannot find module 'MD5'

tzvimoshe avatar May 07 '14 02:05 tzvimoshe

Because the module MD5 haven't been install. You're possibly on an unsupported node.js version - try updating.

SBoudrias avatar May 07 '14 04:05 SBoudrias

same happens to me. I am using windows 2008 R2, administrator. Fails now

astw avatar Nov 16 '14 08:11 astw

I also have this problem on ubuntu 14.10. Updating node.js, nor unisntalling -> cleaning the cache -> reinstalling worked for me. Here's my error log after running "sudo npm install -g yo":

/usr/bin/yo -> /usr/lib/node_modules/yo/cli.js

> [email protected] postinstall /usr/lib/node_modules/yo
> yodoctor


module.js:340
    throw err;
          ^
Error: Cannot find module './doctor'
    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> (/usr/lib/node_modules/yo/node_modules/yeoman-doctor/cli.js:4:1)
    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)

npm ERR! [email protected] postinstall: `yodoctor`
npm ERR! Exit status 8
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!     yodoctor
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.16.0-24-generic
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install" "-g" "yo"
npm ERR! cwd /home/phil/heroku
npm ERR! node -v v0.10.33
npm ERR! npm -v 1.4.28
npm ERR! code ELIFECYCLE
npm ERR! not ok code 0

olsonpm avatar Nov 16 '14 09:11 olsonpm

I also cannot install yo. I get the same output as @olsonpm (I´m running on OSX)

cmartin81 avatar Nov 16 '14 09:11 cmartin81

I found a solution. There is something about the lates yo module. So if you check all the version of yo:

$npm show yo versions

[ '1.0.0-beta.1',
  '1.0.0-beta.2',
  '1.0.0-beta.3',
  '1.0.0-beta.4',
  '1.0.0-beta.5',
  '1.0.0-beta.6',
  '1.0.0-beta.7',
  '1.0.0-rc.1',
  '1.0.0-rc.1.1',
  '1.0.0-rc.1.2',
  '1.0.0-rc.1.3',
  '1.0.0-rc.1.4',
  '1.0.0',
  '1.0.1',
  '1.0.2',
  '1.0.3',
  '1.0.4',
  '1.0.5',
  '1.0.6',
  '1.0.7-pre.1',
  '1.0.7-pre.2',
  '1.0.7-pre.3',
  '1.1.0',
  '1.1.1',
  '1.1.2',
  '1.2.0',
  '1.2.1',
  '1.3.0',
  '1.3.2',
  '1.3.3' ]

And now try to install the 1.3.2 insted of the latest:

npm install -g [email protected]

Then it should work.

cmartin81 avatar Nov 16 '14 10:11 cmartin81

Ha - it works now due to the following commit:

https://github.com/yeoman/doctor/commit/f00e11c5b041a67f3033d698675eb1e7dd5cfd66#diff-2cce40143051e25f811b56c79d619bf5

Thanks for the fix 'sindresorhus'

olsonpm avatar Nov 16 '14 10:11 olsonpm

thanks for info!

On 16 Nov 2014, at 11:17, olsonpm [email protected] wrote:

Ha - it works now due to the following commit:

yeoman/doctor@f00e11c#diff-2cce40143051e25f811b56c79d619bf5 https://github.com/yeoman/doctor/commit/f00e11c5b041a67f3033d698675eb1e7dd5cfd66#diff-2cce40143051e25f811b56c79d619bf5 Thanks for the fix 'sindresorhus'

— Reply to this email directly or view it on GitHub https://github.com/yeoman/yo/issues/128#issuecomment-63213458.

cmartin81 avatar Nov 16 '14 10:11 cmartin81