Yo angular error?

I installed Yeoman on my Mac (OS X 10.9) and I am trying to run yo angular.

I get the following error:

path.js:384
    throw new TypeError('Arguments to path.join must be strings');
          ^
TypeError: Arguments to path.join must be strings
at exports.join (path.js:384:15)
at Generator.<anonymous> (/usr/local/lib/node_modules/generator-angular/common/index.js:26:34)
at Generator.setupEnv (/usr/local/lib/node_modules/generator-angular/common/index.js:29:3)
at /usr/local/lib/node_modules/generator-angular/node_modules/yeoman-generator/lib/base.js:387:14
at processImmediate [as _immediateCallback] (timers.js:374:17)

Software versions

  • node 0.11.13
  • npm 1.4.26
  • yo 1.1.2
  • bower 1.3.9
  • grunt-cli 0.1.13

yo also says there is an update for yo (1.2.1) but it won't install with npm update -g yo

I also tried installing on another machine with the same result (following the yeoman guide http://yeoman.io/codelab/setup.html)

If anyone could help me out I would be very thankful.

To be able to update yo, you will need to have the executable file under a folder you have write permission on.

I work on Mac, and to solve this issue I had to do the following:

First; Change where npm installs global modules. Run

$ npm config set prefix="/home/USERNAME/npm"

Then; Add the new path to the $PATH variable (in your .bash_profile or .bashrc)

PATH=$PATH:/home/USERNAME/npm/bin
export PATH

Finally; Un-install your global npm packages and re-install them using the new configuration.