Skip to content

Check detected default npm path is really existing #23925

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

Merged
merged 1 commit into from
May 8, 2018

Conversation

rhysd
Copy link
Contributor

@rhysd rhysd commented May 6, 2018

Fixes #23924

@rhysd rhysd force-pushed the fix-npm-default-location-detection branch 2 times, most recently from f0ba892 to 1fda3a4 Compare May 7, 2018 04:18
@mhegazy mhegazy requested review from sheetalkamat and a user May 7, 2018 19:53
@mhegazy
Copy link
Contributor

mhegazy commented May 7, 2018

@sheetalkamat and @Andy-MS can you please review.

@sheetalkamat
Copy link
Member

Why do we look in "node" folder at all? Why not always use it as "npm" so that we use default npm location and users wanting to use custom npm location can use the --npmLocation

@mhegazy
Copy link
Contributor

mhegazy commented May 7, 2018

Why do we look in "node" folder at all?

VS does not have npm installed globally, it is installed in a local folder, next to node.

Why not always use it as "npm" so that we use default npm location and users wanting to use custom npm location can use the --npmLocation

we could, but that would break existing users of the server. and back then we did not have the npm location flag.

@sheetalkamat
Copy link
Member

Actually do we need to check it as fileExists or Any type of entry is ok?

@rhysd
Copy link
Contributor Author

rhysd commented May 8, 2018

You mean we should also check the file has executable permission? Maybe. But I think there is no case where npm file is not executable (e.g. directory) in the same directory as node command.

@mhegazy mhegazy merged commit 27550d3 into microsoft:master May 8, 2018
@mhegazy
Copy link
Contributor

mhegazy commented May 25, 2018

The check checks for the existence of a file called npm which never exists, it is an executable file though, so either npm.exe or npm.cmd or npm.bat.. so this ends up breaking VS.

Reverted in #24425.

We need a better fix for the original issue.

mhegazy added a commit that referenced this pull request May 25, 2018
@rhysd
Copy link
Contributor Author

rhysd commented May 27, 2018

@mhegazy ok, so should we check one of npm, npm.exe, npm.cmd or npm.bat exists?

@mhegazy
Copy link
Contributor

mhegazy commented May 28, 2018

I think we should list the directory and see if an npm file exist.

@rhysd
Copy link
Contributor Author

rhysd commented May 28, 2018

@mhegazy I see. Actually I'm not a Windows user. So I don't know the list of possible installation directories for npm command...

@mhegazy
Copy link
Contributor

mhegazy commented May 29, 2018

this is not a windows thing. it is a VS thing. VS ships node and npm in-box but in some custom folders. the only thing we know is that there is an npm (likely npm.bat) next to node.exe that is used to run the server.

@microsoft microsoft locked and limited conversation to collaborators Jul 31, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants