yeoman / yeoman-app

A desktop app that scaffolds projects using Yeoman

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Generators path not found causing no installed generators message.

mfunkie opened this issue · comments

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.

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.

@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.

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?

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.

@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());"?

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.

@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.

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

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.

That would be super helpful 👍 Thank you