Search code examples
asp.netterminalyeomanyeoman-generatorosx-yosemite

Using Yeoman aspnet generators


I am trying to develop ASP.NET applications using a macbook computer with the Yosemite operating system.

I've retrieved the DNVM using Homebrew with the following commands:

brew tap aspnet/dnx
brew update
brew install dnvm

I've also setup the ASP.NET generator using the following commands:

npm install -g yo generator-aspnet  
npm install -g bower grunt-cli gulp-cli

At this point, everything should be ready to go. However, when I type yo aspnet in the terminal, it generates an error that states -bash: yo: command not found. What could be causing this and is there an easy fix?

I've referenced multiple resources, the two best listed below:
Reference_01: https://code.visualstudio.com/docs/aspnet5

Reference_02: http://tattoocoder.azurewebsites.net/vscode-creating-an-application-with-yeoman-aspnet-generators/

UPDATE I made sure to install the following and it still won't recognize yo aspnet

  • node.js: brew install node
  • Yeoman: npm install -g yo
  • Install: npm install -g generator-aspnet
  • Run: yo aspnet

Solution

  • You need to change the permissions of your usr/local folders by running the following code:

    sudo chown -R $USER /usr/local

    sudo chown -R yourUsername ~/.npm

    npm install -g yo grunt-cli bower

    Once you have completed this step, reset the generator-aspnet by running the following lines of code:

    npm install -g yo generator-aspnet

    npm install -g bower grunt-cli gulp-cli

    Now you should be able to run your executable line:

    yo aspnet