Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generators installed while using NVM are not showing in Yo generators list #406

Closed
tconroy opened this issue Jan 19, 2016 · 8 comments
Closed
Labels

Comments

@tconroy
Copy link

tconroy commented Jan 19, 2016

Node Version: v4.2.4 (set via NVM)
NPM Version: v3.5.4 (set via NVM)
Yo version: 1.5.1
OS: OSX 10.11.2

I use NVM to hop between Node versions. My system Node version is 0.12.9, and I've installed 4.2.4 through NVM.

When I try to install a generator in 4.2.4 (for example, npm install -g generator-react-webpack), the generator appears to download and install correctly, however when I then try to use it via yo react-webpack, I get the message:

Error react-webpack

You don't seem to have a generator with the name react-webpack installed.
You can see available generators with npm search yeoman-generator and then install them with npm install [name].
To see the 32 registered generators run yo with the `--help` option.

when I run plain old yo, the react-webpack generator is not listed.

Here's some debug info (executed in project root):

$ yo --version && echo $PATH $NODE_PATH && node -e 'console.log(process.platform, process.versions)' && cat Gruntfile.js
1.5.1
/Users/Tom/.rvm/gems/ruby-2.0.0-p645/bin:/Users/Tom/.rvm/gems/ruby-2.0.0-p645@global/bin:/Users/Tom/.rvm/rubies/ruby-2.0.0-p645/bin:/Users/Tom/.nvm/versions/node/v4.2.4/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/Tom/.rvm/bin
darwin { http_parser: '2.5.0',
  node: '4.2.4',
  v8: '4.5.103.35',
  uv: '1.7.5',
  zlib: '1.2.8',
  ares: '1.10.1-DEV',
  icu: '56.1',
  modules: '46',
  openssl: '1.0.2e' }
cat: Gruntfile.js: No such file or directory

running npm -g root

$ npm -g root
/Users/Tom/.nvm/versions/node/v4.2.4/lib/node_modules

Here is the output of yo doctor:

$ yo doctor

Yeoman Doctor
Running sanity checks on your system

✔ Global configuration file is valid
✔ NODE_PATH matches the npm root
✔ Node.js version
✔ No .bowerrc file in home directory
✔ No .yo-rc.json file in home directory
✔ npm version

Everything looks all right!

any ideas?

@SBoudrias
Copy link
Member

ls /Users/Tom/.nvm/versions/node/v4.2.4/lib/node_modules/generator-react-webpack and make sure the same folder is chown to you.

@tconroy
Copy link
Author

tconroy commented Jan 19, 2016

appears to be:

$ ls -l /Users/Tom/.nvm/versions/node/v4.2.4/lib/node_modules/generator-react-webpack
total 48
-rw-r--r--    1 Tom  staff   1637 Jan 13 01:54 CHANGELOG.md
-rw-r--r--    1 Tom  staff   1052 Sep 22 01:19 LICENSE
-rw-r--r--    1 Tom  staff   5597 Dec 29 02:20 README.md
drwxr-xr-x    4 Tom  staff    136 Jan 19 17:35 generators
-rw-r--r--    1 Tom  staff    159 Nov 20 02:28 jsconfig.json
drwxr-xr-x  343 Tom  staff  11662 Jan 19 17:35 node_modules
-rw-r--r--    1 Tom  staff   3008 Jan 19 17:35 package.json
drwxr-xr-x    5 Tom  staff    170 Jan 19 17:35 test

@billyvg
Copy link

billyvg commented Feb 13, 2016

I'm having the same problem, I'm setting NODE_PATH to my nvm node_modules dir as a temp fix.

@kmcgrath
Copy link

kmcgrath commented May 5, 2016

Having problems even with NODE_PATH being set:

USLT-205529:~ kevin.mcgrath$ yo
? 'Allo Kevin! What would you like to do? Install a generator
? Search npm for generators: lambda-formation
? Here's what I found. Official generator → ෴
  Install one? lambda-formation Yeoman generator for creating Lambda projects compatible with CloudFormation
/Users/kevin.mcgrath/.nvm/versions/node/v6.0.0/lib
└── generator-lambda-formation@0.1.3 


I just installed a generator by running:

    npm install -g generator-lambda-formation

? 'Allo Kevin! What would you like to do? Get me out of here!

     _-----_
    |       |    .-----------------------.
    |--(o)--|    |      Bye from us!     |
   `---------´   |       Chat soon.      |
    ( _´U`_ )    |      Yeoman team      |
    /___A___\    |    http://yeoman.io   |
     |  ~  |     '-----------------------'
   __'.___.'__   
 ´   `  |° ´ Y ` 

USLT-205529:~ kevin.mcgrath$ yo --generators
Available Generators:

  Couldn't find any generators, did you install any? Troubleshoot issues by running

  $ yo doctor
USLT-205529:~ kevin.mcgrath$ echo $NODE_PATH
/Users/kevin.mcgrath/.nvm/versions/node/v6.0.0/lib/node_modules
USLT-205529:~ kevin.mcgrath$ ls -al /Users/kevin.mcgrath/.nvm/versions/node/v6.0.0/lib/node_modules
total 0
drwxr-xr-x   5 kevin.mcgrath  382466515  170 May  4 21:27 .
drwxr-xr-x   4 kevin.mcgrath  382466515  136 Apr 26 15:41 ..
drwxr-xr-x   5 kevin.mcgrath  382466515  170 May  4 21:27 generator-lambda-formation
drwxr-xr-x  23 kevin.mcgrath  382466515  782 Apr 26 15:42 npm
drwxr-xr-x   6 kevin.mcgrath  382466515  204 May  4 21:22 yo
USLT-205529:~ kevin.mcgrath$ yo doctor

Yeoman Doctor
Running sanity checks on your system

✔ Global configuration file is valid
✔ Node.js version
✔ No .bowerrc file in home directory
✔ No .yo-rc.json file in home directory
✔ npm version
✔ NODE_PATH matches the npm root

Everything looks all right!

I've tried with node versions 4 and 5 also, with the same result.

@SBoudrias
Copy link
Member

Try updating yo npm -g update yo. We release a new version of yeoman-environment that should account better for people using nvm.

@efernandesng
Copy link

In my case I've resolve removing yo module installed with system node package and install again using with nvm node.

$ nvm use system
$ sudo npm uninstall yo -g
$ nvm use 4
$ npm i yo -g

@honeyjie
Copy link

Yeoman Doctor
Running sanity checks on your system

✔ Global configuration file is valid
✔ NODE_PATH matches the npm root
✔ Node.js version
✖ No .bowerrc file in home directory

We found a undefined file in your home directory. This can cause
issues by overriding expected default config. Prefer setting up one .bowerrc per
project.

To delete the file, run: rm ~/.bowerrc

✖ No .yo-rc.json file in home directory

Found a NaN file in your home directory. Delete it otherwise
Yeoman will generate everything in your home rather then your project folder.

To delete the file, run: rm ~/.yo-rc.json

✔ npm version

Found potential issues on your machine :(
/usr/local/lib
└── yo@1.8.5

@mozillalives
Copy link

Just adding a comment here in case anyone comes to this page and doesn't find the solution above.

The reason I had issues on my machine was because I first installed node using homebrew, then I installed yo through homebrew node, then I switched to nvm and uninstalled homebrew node. Unfortunately this left the brew installed yo and node_modules in my PATH. I probably could have just altered my PATH, but instead I decided to just delete the unneeded yo and node_modules.

rm /usr/local/bin/yo
rm -rf /usr/local/lib/node_modules

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

No branches or pull requests

8 participants