Closed foxyblocks closed 10 years ago
You need to be using version 1.2 of yo. Run npm update -g yo
I am having the same error. Using npm list -g yo
results in
├─┬ generator-angular-fullstack@2.0.4
│ └── yo@1.2.0
└── yo@1.2.0
Any ideas?
EDIT: I removed the nodejs installation, the node_modules folder and reinstalled everything. Seems to be working now. I suspect it had to do with me installing multiple versions of nodejs
Yeah, I'm getting this too with yo@1.2.1. Updating node from 10.25 to 10.31 (using sudo n stable
) seems to have worked.
Can we put something in the generator to check versions and error out when they're not where we want? Would save some folks some hair-pulling....
I'm getting this with yo@1.2.1
and node 0.10.31
. I have fixed this by reverting to yo@1.2.0
I'm with @thomporter ... This has been a pain.
Just for the record, I'm using yo@1.2.1
and node@0.10.31
with no such errors. I'm wondering if you guys are having issues related to global dependencies or npm cache.
I use nvm
to manage my node versions and also separate global dependencies from the different versions of node. Also when fetching a new version of node, I typically clear my npm cache like so: npm cache clean
before installing the globals for the new version (new as in: new to my system).
I got the same issue:
[?] Existing .yo-rc configuration found, would you like to use it? No
# Client
[?] What would you like to write scripts with? JavaScript
[?] What would you like to write markup with? HTML
[?] What would you like to write stylesheets with? Sass
[?] What Angular router would you like to use? uiRouter
[?] Would you like to include Bootstrap? Yes
[?] Would you like to include UI Bootstrap? Yes
# Server
[?] Would you like to use mongoDB with Mongoose for data modeling? Yes
[?] Would you scaffold out an authentication boilerplate? Yes
[?] Would you like to include additional oAuth strategies? Google, Facebook, Twitter
[?] Would you like to use socket.io? Yes
/usr/lib/node_modules/generator-angular-fullstack/node_modules/yeoman-generator/lib/base.js:562
generator = this.env.instantiate(Generator, options);
^
TypeError: Object #<Environment> has no method 'instantiate'
at composeWith (/usr/lib/node_modules/generator-angular-fullstack/node_modules/yeoman-generator/lib/base.js:562:26)
at yeoman.generators.Base.extend.compose (/usr/lib/node_modules/generator-angular-fullstack/app/index.js:223:10)
at /usr/lib/node_modules/generator-angular-fullstack/node_modules/yeoman-generator/lib/base.js:395:14
at processImmediate [as _immediateCallback] (timers.js:345:15)
npm -v
1.4.28
nodejs -v
v0.10.32
yo -v
1.1.2
As you can see yo is on version 1.1.2 so i ran npm install yo@1.3.2. After that i checked the version again and it was still 1.1.2.
I think its a link problem. After i used nodejs /usr/lib/node_modules/yo/cli.js angular-fullstack everything generated fine cause in /usr/lib/node_modules/yo is the right version (1.3.2)
How can i fix this so i can just type yo instead of the full path?
@maluramichael if you are on a "nix" like system you can run which yo
to find out the location of the yo
program that is executed when you omit the path.
@kingcody i'll try this tonight.
michael@synapse ~/development $ which yo
/usr/local/bin/yo
michael@synapse ~/development $ cd /usr/local/bin/
michael@synapse /usr/local/bin $ ls -la | grep yo
lrwxrwxrwx 1 root root 29 Okt 20 20:28 yo -> ../lib/node_modules/yo/cli.js
michael@synapse /usr/local/bin $ yo -v
1.1.2
michael@synapse /usr/local/bin $ nodejs /usr/lib/node_modules/yo/
cli.js node_modules/ package.json readme.md yoyo.js
michael@synapse /usr/local/bin $ nodejs /usr/lib/node_modules/yo/cli.js -v
1.3.2
So /usr/local/lib/node_modules/yo/cli.js
is outdated but /usr/lib/node_modules/yo/cli.js
is current. /usr/local
is probably first in your path.
$PATH
Can you point to a simple fix...until now i am doing 'node /usr/lib/node_modules/yo/cli.js angular-fullstack' instead of 'yo angular-fullstack' !!
There is a common issue with NVM that can cause this issue. The issue happens as follows
At this point everything looks peachy, but the NVM node picks up on your old .npmrc files and will install everything into your old NPM directory (usually /usr/local/bin I think). You really don't want this, because it kind of defeats the purpose of NVM. You con confirm that this is your issue by running npm config get prefix
. If the path you get looks like .nvm/something then you could have another problem. Otherwise, the following steps should clean things up:
npm config get globalconfig
and npm config get userconfig
to get the location of your .npmrc files.nvm uninstall [version]
rm -rf ~/.nvm
ought to do the trick.npm config get prefix
. You should get .nvm/something.which yo
. You should get a path like .nvm/somewhere/yoGood luck
Very well crafted response @robbyemmert . +1 internet to you, sir.
Agreed with @Awk34 , thank you @robbyemmert , that helped a LOT!
make sure you also have yeoman installed correctly, you will see similar errors if you don't have bower, grunt-cli and gulp installed.
Running
yo angular-fullstack [app-name]
fails with: