yo aspnet generator not detected - yeoman

I am using ubuntu vivid. Trying to use yeoman aspnet generator. Installed the generators using below commands
sudo npm install -g yo
sudo npm install -g generator-aspnet
When i try using it using the command : yo aspnet
i get the below error
Error aspnet
You don't seem to have a generator with the name aspnet installed. You can see available generators with npm search yeoman-generator and then >install them with npm install [name]. To see the 0 registered generators run yo with the `--help` option.
I am able to see the generator files under /usr/local/lib/node_modules/generator-aspnet
What am i missing?

For any Yeoman issues, always run yo doctor.

Related

Trying to install bower in mac but getting semver-utils#1.1.1 issue

I typed sudo npm install -g bower getting this issue again and again
/usr/local/bin/bower -> /usr/local/lib/node_modules/bower/bin/bower
bower#1.7.2 /usr/local/lib/node_modules/bower
└── semver-utils#1.1.1
This doesn't look like an error at all. semver-utils is a library required by bower after 1.7.1.
Maybe run bower in the command line and show us the error you're getting.

Yeoman : no generator installed error

I'm trying to setup angularfire generator.
I did npm install -g generator angularfire
The generator was installed successfuly.
And when I run yo angularfire in my newly created directory,it asks few options like firebase instance and which modules to include , but after that it shows the following error
You don't seem to have a generator with the name angularfire:common:C:\Users\SATWIK\AppData\Roaming\npm\node_modules\generator-angularfire\app\index.js installed.
Also I've checked that the file index.js does exist at this path.
As suggested in some of the answers on stackoverflow I've also tries npm install -G generator-angularfire and npm install generator-angularfire but none of them worked.
I also did yo doctor but it shows Everything is fine . Is there any fix to this problem?
This is a regression we had in our last release. It's now fixed https://github.com/yeoman/environment/releases/tag/v1.5.2
npm -g update yo to fix that issue.

Is the Bower command missing from project?

I have a deploy.cmd script that I built using these steps. It is being used to package a project up for deployment to Azure. In it there is this line:
IF EXIST "%DEPLOYMENT_TARGET%\bower.json" (
pushd "%DEPLOYMENT_TARGET%"
call :ExecuteCmd .\node_modules\.bin\bower install
IF !ERRORLEVEL! NEQ 0 goto error
popd
When I test the script locally, it fails because there is no bower command in the .bin directory. I have installed bower using -g and have used it to install project packages. But I can't figure out how it's supposed to make it into this folder.
It'll make it to that folder if you run npm install bower without -g. -g is meant to install tools globally to be available anywhere on your commandline, while not adding -g will install it locally in the node_modules folder

iOS Yosemite sudo npm install -g DYLD_ environment

I have a problem after I upgraded my machine to Yosemite, whenever I run sudo npm install -g ... I got an error says
/usr/bin/dyld: DYLD_ environment variables being ignored because main executable (/usr/bin/sudo) is setuid or setgid
For example was trying to install gulp using
sudo npm install -g gulp
and got the same error ! not able to find the reason behind this issue
Generally this means that an existing, globally installed package is in bad shape. Possibly permissions related, but hard to say for sure without more information about the environment.
The solution lies in fixing the broken package. One way to do so is delete and re-install it. Try sudo npm uninstall -g <pkg> where <pkg> is anything you suspect may be broken.
If you are not sure where to start, do:
npm list -g --depth=0
That will show you all of your globally installed packages. Just remove and re-install them one by one.
If any of those throw errors during the removal process, you will need to do it yourself, manually.
First, figure out where global packages are installed. Generally, this will be /usr/local on OS X, for example. To find out for sure:
npm config get prefix
Then explore that directory, especially /usr/local/bin (for example) and if you are sure a file is related to a global npm package, it's usually safe to remove it.
`sudo rm -rf <file>`
... where <file> is the actual filename you wish to delete.
You may have gotten into this mess due to overuse of sudo.
See my answer to SNAFU with npm update -g on why sudo is bad and instructions on how to fix it.

How to remove a Yeoman generator

I accidentally installed a generator that I don't want.
I can't find any method to remove it.
What should I do to accomplish this?
Generators are just normal npm modules, so you can remove it with
npm uninstall -g generator-[nameOfGenerator]
npm uninstall -g [generator-name] might not fix the UNMET DEPENDENCY.
If you won't mind to reinstall the affected modules:
cd to your npm directory (e.g. /usr/local/bin/node_modules)
rm -rf [generator-name]
npm cache clean
npm install -g [generator-name]
Search for generators with
npm list -g --depth=0 | grep 'generator'
Remove generator with
npm uninstall -g [generator-name]
NOTE: Don't include '#[version] ' that follows the generator name
I wanted to add something for posterity:
If you get an number of errors of class 'peerDependencies' for yeoman's generators, updating yo alone will not cut it - you need to remove all generators that throw the error and then reinstall whatever module lead to the trouble.
Unfortunately, as far as I ahve chekced, regex is not supported by npm.

Resources