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

Global installed package with wrong startup script #2474

Closed
vale1534 opened this issue Jan 17, 2017 · 3 comments
Closed

Global installed package with wrong startup script #2474

vale1534 opened this issue Jan 17, 2017 · 3 comments

Comments

@vale1534
Copy link

I installed my Node.JS in D:\Node\v6.9.1 , then I use Yarn install the global package successfully:

yarn install webpack

However, when I run it:

λ webpack
The filename, directory name, or volume label syntax is incorrect.

I discovered that Yarn install global package at C:\Users\Wenris\AppData\Local\Yarn\config\global instead of C:\Users\Wenris\AppData\Roaming\npm , where my NPM choose.

That's all right, but Yarn installed a wrong startup script webpack.cmd in my Node.JS root dir:

λ cat webpack.cmd
@"%~dp0\C:\Users\Wenris\AppData\Local\Yarn\config\global\node_modules\.bin\webpack.cmd" %*

So?

@vale1534
Copy link
Author

vale1534 commented Jan 17, 2017

If I changed the script to:

echo @"%~dp0\C:\Users\Wenris\AppData\Local\Yarn\config\global\node_modules\.bin\webpack.cmd" %*

Then I got:

λ webpack
@"D:\Node\v6.9.1\\C:\Users\Wenris\AppData\Local\Yarn\config\global\node_modules\.bin\webpack.cmd"

@anjia0532
Copy link

#2630

@Daniel15
Copy link
Member

Daniel15 commented Apr 23, 2017

This is a bug with cmd-shim when Node.js is on a different hard-drive than Yarn's cache: npm/cmd-shim#21. It should be fixed in cmd-shim. Once a new version is available, we can update the dependency in Yarn.

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

3 participants