yarn icon indicating copy to clipboard operation
yarn copied to clipboard

Global installed package with wrong startup script

Open vale1534 opened this issue 9 years ago • 3 comments

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 avatar Jan 17 '17 02:01 vale1534

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"

vale1534 avatar Jan 17 '17 02:01 vale1534

https://github.com/yarnpkg/yarn/issues/2630

anjia0532 avatar Feb 04 '17 14:02 anjia0532

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

Daniel15 avatar Apr 23 '17 04:04 Daniel15