slushjs / slush

The streaming scaffolding system - Gulp as a replacement for Yeoman
http://slushjs.github.io/generators
MIT License
1.24k stars 58 forks source link

Generators not found #50

Open dmassiani opened 8 years ago

dmassiani commented 8 years ago

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 commented 8 years ago

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 commented 8 years ago

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 commented 8 years ago

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

dmassiani commented 8 years ago

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

joakimbeng commented 8 years ago

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 commented 8 years ago

Sorry but slush being installer after nvm

joakimbeng commented 8 years ago

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

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 commented 8 years ago

@dmassiani any progress with this?

dmassiani commented 8 years ago

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

joakimbeng commented 8 years ago

@dmassiani no worries, I know how it is!

KErez commented 8 years ago

It looks like slush don't take npm's _/lib/nodemodules 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 commented 8 years ago

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.