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

Problem when running cake.npm in WSL #133

Closed
fasterinnerlooper opened this issue Mar 1, 2021 · 3 comments
Closed

Problem when running cake.npm in WSL #133

fasterinnerlooper opened this issue Mar 1, 2021 · 3 comments

Comments

@fasterinnerlooper
Copy link

fasterinnerlooper commented Mar 1, 2021

Hi. I have a WSL installation where I can run NPM commands without issue from the command line, but if I try to use cake.npm to run my commands, it finds the Windows version of NPM and tries to run that in the Linux environment.
I can work around the problem by removing the Windows paths from $PATH, but I can't understand why it runs ok from the command line but doesn't run properly when using cake.npm.

Here is a snippet of the diagnostic output when running cake.npm's run-script command:

Executing task: Default
Using addin: Cake.Npm v0.0.0.0 ([NULL])
npm arguments: run-script --loglevel verbose "build"
Resolved tool to path /mnt/c/Program Files/nodejs/npm.cmd
Executing: /mnt/c/Program Files/nodejs/npm.cmd run-script --loglevel verbose "build"
@fasterinnerlooper
Copy link
Author

@gep13 @devlead

@fasterinnerlooper
Copy link
Author

fasterinnerlooper commented Mar 1, 2021

Here is the output if I set PATH to /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/wsl/lib:

Executing task: Default
Using addin: Cake.Npm v0.0.0.0 ([NULL])
npm arguments: run-script --loglevel verbose "build"
Could not resolve path for tool "npm.cmd" using these directories: /usr/local/sbin,/usr/local/bin,/usr/sbin,/usr/bin,/sbin,/bin,/usr/games,/usr/local/games,/usr/lib/wsl/lib
Resolved tool to path /usr/bin/npm
Executing: /usr/bin/npm run-script --loglevel verbose "build"

And it runs as expected.

@pascalberger
Copy link
Member

Updating the path is the correct workaround for the time being. Cake 1.1 will improve tool detection in this case cake-build/cake#3066

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

2 participants