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 path not found causing no installed generators message. #46

Open
mfunkie opened this issue Jul 26, 2015 · 10 comments
Open

Generators path not found causing no installed generators message. #46

mfunkie opened this issue Jul 26, 2015 · 10 comments

Comments

@mfunkie
Copy link
Contributor

mfunkie commented Jul 26, 2015

When running the Yeoman app, I noticed that in this block of code

https://github.com/yeoman/yeoman-app/blob/master/src/browser/yo/environment.js#L18

The path was not successfully split.

I started with the full path before: /usr/local/lib/node_modules/npm/bin/node-gyp-bin /Users/mfunk/Documents/yeoman-app/node_modules/.bin /usr/local/bin /usr/bin /bin /usr/sbin /sbin

And the array of paths after is ['/usr/local/lib/node_modules/npm/bin/node-gyp-bin /Users/mfunk/Documents/yeoman-app/node_modules/.bin /usr/local/bin /usr/bin /bin /usr/sbin /sbin']

If the paths were successfully split, it would have found my generators properly.

@mfunkie
Copy link
Contributor Author

mfunkie commented Jul 26, 2015

Before fix-path is run, my path properly has : between the paths, after require('fix-path')(), my path no longer has : between the paths, but the delimiter is still considered to be :. Commenting out the fix-path line fixes the issue.

@SBoudrias
Copy link
Member

@sindresorhus Any input on what is going on here?

Also, I feel like if we need "fix-path", then we should probably implement this directly in yeoman-environment so it support multiple type of environment.

@stefanbuck
Copy link
Member

we should probably implement this directly in yeoman-environment so it support multiple type of environment.

Sounds sensible. Should I prepare a PR for it?

@sindresorhus
Copy link
Member

we should probably implement this directly in yeoman-environment so it support multiple type of environment.

No, it's for OS X GUI apps. There's absolutely no reason for it to be in yeoman-environment.

@sindresorhus
Copy link
Member

@mfunkie Weird. Works fine for me. What OS are you on? What do you get when running /bin/sh -i -c 'echo $PATH'? And when running node -e "console.log(require('child_process').execFileSync(process.env.SHELL || '/bin/sh', ['-c', 'echo $PATH']).toString().trim());"?

@stefanbuck
Copy link
Member

But then we should at least provide a better way to pass a specific $PATH to yeoman-enviroment. Overriding getNpmPaths() is not the perfect solution.

@sindresorhus
Copy link
Member

@stefanbuck No. The fix-path module fixes a limitation of OS X GUI apps not inheriting the $PATH of your shell. yeoman-generator shouldn't require any knowledge of that limitation.

@stefanbuck
Copy link
Member

@mfunkie any news on your side regarding this issue? Did you tried what @sindresorhus suggested?

@mfunkie
Copy link
Contributor Author

mfunkie commented Mar 28, 2016

Oh wow, I haven't thought about it in months. I could take another look in the next couple of days if that would help.

@stefanbuck
Copy link
Member

That would be super helpful 👍 Thank you

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