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

node_gyp issue on Windows #65

Closed
ffMathy opened this issue Jan 9, 2020 · 4 comments
Closed

node_gyp issue on Windows #65

ffMathy opened this issue Jan 9, 2020 · 4 comments

Comments

@ffMathy
Copy link

ffMathy commented Jan 9, 2020

When running npm install tree-sitter-c-sharp --save on Windows.

gyp ERR! UNCAUGHT EXCEPTION
gyp ERR! stack Error: spawn C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\15.0\Bin\MSBuild.exe ENOENT
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:240:19)
gyp ERR! stack at onErrorNT (internal/child_process.js:415:16)
gyp ERR! stack at process._tickCallback (internal/process/next_tick.js:63:19)
gyp ERR! System Windows_NT 10.0.18363
gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\mathi\source\repos\FluffySpoon.JavaScript.CSharpParser\node_modules\tree-sitter-c-sharp
gyp ERR! node -v v10.16.3
gyp ERR! node-gyp -v v3.8.0
gyp ERR! This is a bug in node-gyp.
gyp ERR! Try to update node-gyp and file an Issue if it does not help:
gyp ERR! https:/nodejs/node-gyp/issues
npm ERR! code ELIFECYCLE
npm ERR! errno 7
npm ERR! [email protected] install: node-gyp rebuild
npm ERR! Exit status 7
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\mathi\AppData\Roaming\npm-cache_logs\2020-01-09T18_40_23_838Z-debug.log

@maxbrunsfeld
Copy link
Contributor

gyp ERR! stack Error: spawn C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\15.0\Bin\MSBuild.exe ENOENT

It looks like you don't have MSBuild.exe, or node is looking for it in the wrong place? Do you have the C/C++ build tools (Microsoft Visual C++) installed?

@ffMathy
Copy link
Author

ffMathy commented Jan 9, 2020

Thanks for the quick reply! 👍

Is that really required though? Typically node-gyp tries to find an already-compiled version first (perhaps even on GitHub itself)?

Is it possible to enable that for this project as well, so that people aren't required to install all this? It becomes rather painful for library developers if all consumers of that library need these tools also all of a sudden 🙂

@josteink
Copy link

josteink commented Jan 4, 2021

The actual underlying reason seems to be in node-gyp and to me it seems most logical to try to get it fixed there:

nodejs/node-gyp#1753 (comment)

On the flip side, I found the simplest way to solve this was to install Visual Studio 2017 build tools and the right C++ toolset. See my comment in the linked bug.

@damieng
Copy link
Contributor

damieng commented Mar 24, 2021

I think this is out-of-scope for this particular grammar and any such approach would need to be something considered upstream across all grammars not just the C# one.

@damieng damieng closed this as completed Mar 24, 2021
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

4 participants