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 not found #50

Open
dmassiani opened this issue Mar 9, 2016 · 12 comments
Open

Generators not found #50

dmassiani opened this issue Mar 9, 2016 · 12 comments

Comments

@dmassiani
Copy link

Hello,

I install generators globally but slush don't find any generators.
I'm using node 5.0
Please see screenshot
capture d ecran 2016-03-09 a 11 05 02

@joakimbeng
Copy link
Member

Hmm, that's weird.
Where is the slush lib located? What do you get when running:

ls -l `which slush`

Also what does echo $NODE_PATH give you?

@dmassiani
Copy link
Author

ls -l which slush
lrwxr-xr-x 1 root admin 38 9 mar 10:43 /usr/local/bin/slush -> ../lib/node_modules/slush/bin/slush.js

echo $NODE_PATH : empty

@joakimbeng
Copy link
Member

Ok, and what does npm -g root give you?

@dmassiani
Copy link
Author

I use nvm.
/Users/david/.nvm/versions/node/v0.12.7/lib/node_modules

@joakimbeng
Copy link
Member

I see, then I think the issue is caused by slush being installed before nvm was installed. May that be the case? Try to install slush again with: npm i -g slush and see if that solves the issue.

Also the next version of Slush will search for modules in the npm -g root path so then it shouldn't matter if Slush was installed before nvm or not. I haven't had the time to finish that yet though.

@dmassiani
Copy link
Author

Sorry but slush being installer after nvm

@joakimbeng
Copy link
Member

There seems to be multiple paths involved here (and multiple NodeJS versions as well):

  • /usr/local/lib/node_modules/ - which is where slush is installed (and probably slush-angular as well) according to ls -l $(which slush)
  • /Users/david/.nvm/versions/node/v5.0.0/lib/node_modules - which is where slush-angular-gulp is installed according to your screenshot
  • /Users/david/.nvm/versions/node/v0.12.7/lib/node_modules - which is the path that your npm currently installs global modules to according to npm -g root

So I think you should try this:

  1. switch to Node v5 with nvm and verify this with:
    • node -v - should show v5.x.x
    • npm -g root - should show /Users/david/.nvm/versions/node/v5.0.0/lib/node_modules
  2. reinstall slush for this Node version and global modules folder with npm i -g slush
  3. verify that /Users/david/.nvm/versions/node/v5.0.0/lib/node_modules/slush exists
  4. verify that ls -l $(which slush) is pointing to bin/slush.js in the folder in step 3
  5. rerun slush

If step 3 is ok but not 4 try to remove the symlink: rm -f /usr/local/bin/slush and then reinstall slush, hopefully a final time.

@joakimbeng
Copy link
Member

@dmassiani any progress with this?

@dmassiani
Copy link
Author

@joakimbeng sorry, I have many works since few weeks. Before breaking node, I need to finish it :)

@joakimbeng
Copy link
Member

@dmassiani no worries, I know how it is!

@KErez
Copy link

KErez commented Apr 24, 2016

It looks like slush don't take npm's /lib/node_modules in account when collecting lookup paths (see bin/slush.js)
This is an example on how to get the prefix from npm:

var npm = require("npm")
var myConfigObject = {}
npm.load(myConfigObject, function (er) {
    if (er) return handleError(er)
    console.log(npm.get('prefix'));
})

Taken from: http://stackoverflow.com/questions/17229721/how-to-programmatically-get-the-location-where-npm-installs-global-modules

@trevorhiley
Copy link

I just had the same issue. I started to install slush before I remembered to use NVM with the version of Node I wanted to install. I switched to that version using nvm and installed again. By using the commands above I found that it was finding the version of slush that installed before I switched to the current version of nvm. I removed that one manually, and then everything started working.

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

No branches or pull requests

4 participants