0

I'm trying to install yeoman on Mountain Lion.

I've installed (and reinstall several times) node.js through mac package I've installed bower and grunt successfully just in case I've tried to make slinks of node to some bin folders just in case

And always get this error at the end when I try to install yoeman

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

> yo@1.1.0 postinstall /usr/local/lib/node_modules/yo
> node scripts/doctor.js

sh: node: command not found
npm ERR! yo@1.1.0 postinstall: `node scripts/doctor.js`
npm ERR! Exit status 127
....

I doesn't make sense that node command not found, as can run it with or without sudo.

I noticed there's another similar post : npm install -g yo command gives -> ERR! yo@1.1.0 postinstall: `node scripts/doctor.js`

But his error is slightly different, I've tried the solution proposed even though without success.

Any advice? Thanks!

Community
  • 1
  • 1

2 Answers2

1

Ok! I find a solution for my case. Let me explain:

  • I've installed nodejs using the .tar archive and I build it in to the mac 10.8.5.
  • Then I realized there is a package for this OS, I've uninstalled the older version and I've installed the package version. I think I've cleaned up everything from the previous installation.
  • Then I've installed bower, and grunt (not necessary as I've seen later)
  • Then the problem is when I do sudo npm install -g yo it gives me the error shown above.
  • After chage lots of things and versions, I've realized that the problem was the -g option (install globally) I couldn't figure out why this option is not working for this package (yo)
  • I did npm install yo as root user
  • Finally I've moved the new node modules to the usr/local/lib/node_modules forlder , then I've created the soft links of bower, grunt-cli and cli.js to /usr/local/bin as bower, grunt and yo

Hope it could help someone for this case or maybe someone could tell me what I've did wrong at first place.

1

I too had this problem but like you I went to this post first:

npm install -g yo command gives -> ERR! yo@1.1.0 postinstall: `node scripts/doctor.js`

and creating a symlink worked for me, although it needed tweaking to:

sudo ln -s /usr/local/bin/node /usr/bin/node

NB prior to this I uninstalled the previous version of Node and re-installed to v0.10.24, however this didn't fix the problem with the global flag. Using the above symlink did.

Community
  • 1
  • 1
joesch
  • 347
  • 1
  • 5
  • 17
  • this worked for me! The problem I had was related to using nvm to install node on ubuntu (where the default node binary is named nodejs). I ran the command: sudo ln -s `which node` /usr/bin/node. "which node" is surrounded by backticks (comments don't show it). I expect I'll have to rerun this when changing node versions... – Allan Nienhuis May 09 '14 at 18:01