2

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.

Burkhard
  • 14,112
  • 22
  • 84
  • 106

1 Answers1

1

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.

Muhammad Reda
  • 24,289
  • 12
  • 85
  • 99
  • Thank you for your reply it helped me alot. – Erwin van Hoof Sep 14 '14 at 19:20
  • I tried your solution answer first but that didn't work. I had to uninstall everything first (node/npm/yo) after this I added the path Users/USERNAME/npm/bin to my PATH then a new installation of node & npm then I set then config value prefix after this installed Yeoman. This did the job. (Deinstallation I used was from this post http://stackoverflow.com/questions/11177954/how-do-i-completely-uninstall-node-js-and-reinstall-from-beginning-mac-os-x) – Erwin van Hoof Sep 14 '14 at 19:36
  • 1
    I tried to vote up (which I obviously cannot of my score), I haven't tried the acceptance button, but did now and this seems to work. hoorah!!! – Erwin van Hoof Sep 23 '14 at 08:37
  • :) well, you are just 2 reputation points away to be able to upvote :D – Muhammad Reda Sep 23 '14 at 08:45