Skip to content
This repository has been archived by the owner on Mar 26, 2018. It is now read-only.

generator-angular error - new route, controller, directive or filter #120

Closed
janantala opened this issue Mar 16, 2013 · 14 comments
Closed

Comments

@janantala
Copy link

Hello,
I have just updated yeoman to 1.0 and have problem with angular generator.
My installation steps:

$ npm install -g yo grunt-cli bower
$ mkdir test && cd $_
$ npm install generator-angular generator-testacular
$ yo angular
$ npm install && bower install --dev

App works, grunt server works, but I get error if I want to generate a new route, controller, directive or filter.

$ yo angular:controller user
Error angular:controller user 

Invalid namespace: angular:controller (or not yet registered).
 Registered: 4 namespace(s). Run with the `--help` option to list them.

I have
yo version 1.0.0-beta.3
npm version 1.1.59
node version v0.8.8
MAC OS Lion

Thanks for help,
Jan

@aamonten
Copy link

Same here, after running

$ yo angular 
$ npm install && bower install --dev

I'm not able to access any of angular generator options, if I run

$ yo

It doesn't list anymore Angular as an option

yo version 1.0.0-beta.3
npm version 1.1.36
node version v0.8.2
grunt-cli v0.1.6
grunt v0.4.0rc7
bower 0.1.0

@wideblue
Copy link

Same here, after running

$ yo angular

I can access angular generator options, but after running
$ npm install && bower install --dev

I can not anymore.

Win 8 64bit
yo version 1.0.0-beta.3
npm version 1.2.2
node version v0.8.18
grunt-cli v0.1.6
grunt v0.4.0rc7
bower 0.8.5

@digijan
Copy link

digijan commented Mar 20, 2013

Same here. Workarounds / fixes?

@ryanseddon
Copy link

I'm getting this too, yo angular scaffolds the app fine but if I try and add anything else like a route, controller etc it fails with the same error as above.

I'm on OSX Lion.

@ryanseddon
Copy link

So work around for me is to go into the yo directory (/usr/local/lib/node_modules/yo) and run npm install generator-angular. All sub-generators seem to work now.

@amctammany
Copy link

@ryanseddon That fixed all my issues on Mountain Lion. Thanks.

@wideblue
Copy link

Also works on Win system, thou directory is \Users"your username" \AppData\Roaming\npm\node_modules\yo in this case.

@psing008
Copy link

MAC osx 10.8.2.
YO version - 1.0.0-beta.3

I do not have yo directory. my file directory is as follows usr/psing/node_modules and it contains angular, testacular, and karma. I followed the workaround that @ryanseddon posted, but I am still cannot make it produce generators.

@btford
Copy link
Contributor

btford commented Apr 1, 2013

This is very strange. Can one of you please do the following:

After running:

mkdir test && cd $_
npm install generator-angular generator-testacular

Can you do an ls or tree and post the results here?

@psing008
Copy link

psing008 commented Apr 1, 2013

i was trying do run npm install generator-angular generator-testacular in the User directory of my mac. I tried mkdir test && cd $_npm install generator-angular generator-testacular in app/node_modules and that seemed to work fine. I was trying @ryanseddon 's solution in the wrong directory. I am now able to generate angular scaffolding, and it is such a time saver. :)

@a5sk4s
Copy link

a5sk4s commented Apr 5, 2013

Looks like they are installed in the parent directory and no longer reachable after running 'npm install'

$ npm install generator-angular generator-karma
...
generator-karma@0.2.0 ../node_modules/generator-karma
├── colors@0.6.0-1
├── semver@1.1.4
└── yeoman-generator@0.10.3 (debug@0.7.2, mime@1.2.9, mkdirp@0.3.5, isbinaryfile@0.1.8, diff@1.0.4, rimraf@2.1.4, read@1.0.4, nopt@2.1.1, cli-table@0.2.0, glob@3.1.21, tar@0.1.17, underscore.string@2.3.1, cheerio@0.10.8, request@2.12.0, lodash@1.0.1, bower@0.8.6)

generator-angular@0.2.0 ../node_modules/generator-angular
└── yeoman-generator@0.10.3 (debug@0.7.2, mime@1.2.9, nopt@2.1.1, mkdirp@0.3.5, read@1.0.4, rimraf@2.1.4, cli-table@0.2.0, isbinaryfile@0.1.8, diff@1.0.4, glob@3.1.21, tar@0.1.17, cheerio@0.10.8, underscore.string@2.3.1, request@2.12.0, lodash@1.0.1, bower@0.8.6)

$ tree
.

0 directories, 0 files

@btford
Copy link
Contributor

btford commented Apr 6, 2013

That's what I thought. By default, npm installs packages to node_modules in the current directory, unless there's a parent directory that already has a node_modules directory or package.json file in it.

@sindresorhus, any ideas on how to fix this? Maybe touch package.json or mkdir node_moduels after cding into your project dir?

@sindresorhus
Copy link
Member

@btford mkdir node_modules for now. Generators will soon go global.

@btford
Copy link
Contributor

btford commented Apr 7, 2013

Added a note to the readme. Closing.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants