PrestonKnopp / language-gdscript

gdscript language grammar package for atom.io
https://atom.io/packages/lang-gdscript
MIT License
32 stars 9 forks source link

fail installing 6.2.0 #48

Closed RaykWashington closed 2 years ago

RaykWashington commented 3 years ago

Got an error trying to install it from settings/install packages

prebuild-install WARN install No prebuilt binaries found (target=9.4.4 runtime=electron arch=x64 libc= platform=win32) prebuild-install WARN install No prebuilt binaries found (target=9.4.4 runtime=electron arch=x64 libc= platform=win32) gyp ERR! build error gyp ERR! stack Error: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\MSBuild.exe failed with exit code: 1 gyp ERR! stack at ChildProcess.onExit (C:\Users\Rayk\AppData\Local\atom\app-1.57.0\resources\app\apm\node_modules\npm\node_modules\node-gyp\lib\build.js:194:23) gyp ERR! stack at ChildProcess.emit (events.js:223:5) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12) gyp ERR! System Windows_NT 10.0.19042 gyp ERR! command "C:\Users\Rayk\AppData\Local\atom\app-1.57.0\resources\app\apm\bin\node.exe" "C:\Users\Rayk\AppData\Local\atom\app-1.57.0\resources\app\apm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild" gyp ERR! cwd C:\Users\Rayk\AppData\Local\Temp\apm-install-dir-2021526-16472-2dmvn6.cmy5t\node_modules\lang-gdscript\node_modules\tree-sitter-godot-resource gyp ERR! node -v v12.14.1 gyp ERR! node-gyp -v v5.1.0 gyp ERR! not ok npm WARN enoent ENOENT: no such file or directory, open 'C:\Users\Rayk\AppData\Local\Temp\apm-install-dir-2021526-16472-2dmvn6.cmy5t\package.json' npm WARN apm-install-dir-2021526-16472-2dmvn6.cmy5t No description npm WARN apm-install-dir-2021526-16472-2dmvn6.cmy5t No repository field. npm WARN apm-install-dir-2021526-16472-2dmvn6.cmy5t No README data npm WARN apm-install-dir-2021526-16472-2dmvn6.cmy5t No license field.

npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! tree-sitter-godot-resource@0.2.1 install: prebuild-install || node-gyp rebuild npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the tree-sitter-godot-resource@0.2.1 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\Rayk.atom.apm_logs\2021-06-26T15_55_10_276Z-debug.log

dirigonaut commented 3 years ago

I am getting the same error when installing from the atom settings/install packages menu.

@PrestonKnopp the docs mention that one can download the prebuilt dependencies which I am fine with doing as an interim solution but I am not sure where the lang-gdscript expects those files to be located on my file system. If I could get that information I can get past the error until the installation is fixed.

Let me know if there is anything else I can provide to help. Hopefully this can be resolved as I enjoy using the lang-gdscript package in atom.

Atom Install Logs:

Installing “lang-gdscript@6.2.0” failed.Hide output…

> zadeh@3.0.0-beta.4 install C:\Users\<scrubbed_user>\AppData\Local\Temp\apm-install-dir-202171-25672-6nzlmp.jnbkb\node_modules\lang-gdscript\node_modules\zadeh
> node-gyp-build

> tree-sitter-gdscript@1.1.0 install C:\Users\<scrubbed_user>\AppData\Local\Temp\apm-install-dir-202171-25672-6nzlmp.jnbkb\node_modules\lang-gdscript\node_modules\tree-sitter-gdscript
> prebuild-install || node-gyp rebuild

C:\Users\<scrubbed_user>\AppData\Local\Temp\apm-install-dir-202171-25672-6nzlmp.jnbkb\node_modules\lang-gdscript\node_modules\tree-sitter-gdscript>if not defined npm_config_node_gyp (node "C:\Users\<scrubbed_user>\AppData\Local\atom\app-1.58.0\resources\app\apm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "C:\Users\<scrubbed_user>\AppData\Local\atom\app-1.58.0\resources\app\apm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild ) 

prebuild-install WARN install No prebuilt binaries found (target=9.4.4 runtime=electron arch=x64 libc= platform=win32)
gyp ERR! find VS 
gyp ERR! find VS msvs_version not set from command line or npm config
gyp ERR! find VS VCINSTALLDIR not set, not running in VS Command Prompt
gyp ERR! find VS could not use PowerShell to find Visual Studio 2017 or newer
gyp ERR! find VS looking for Visual Studio 2015
gyp ERR! find VS - not found
gyp ERR! find VS not looking for VS2013 as it is only supported up to Node.js 8
gyp ERR! find VS 
gyp ERR! find VS **************************************************************
gyp ERR! find VS You need to install the latest version of Visual Studio
gyp ERR! find VS including the "Desktop development with C++" workload.
gyp ERR! find VS For more information consult the documentation at:
gyp ERR! find VS https://github.com/nodejs/node-gyp#on-windows
gyp ERR! find VS **************************************************************
gyp ERR! find VS 
gyp ERR! configure error 
gyp ERR! stack Error: Could not find any Visual Studio installation to use
gyp ERR! stack     at VisualStudioFinder.fail (C:\Users\<scrubbed_user>\AppData\Local\atom\app-1.58.0\resources\app\apm\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:121:47)
gyp ERR! stack     at C:\Users\<scrubbed_user>\AppData\Local\atom\app-1.58.0\resources\app\apm\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:74:16
gyp ERR! stack     at VisualStudioFinder.findVisualStudio2013 (C:\Users\<scrubbed_user>\AppData\Local\atom\app-1.58.0\resources\app\apm\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:351:14)
gyp ERR! stack     at C:\Users\<scrubbed_user>\AppData\Local\atom\app-1.58.0\resources\app\apm\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:70:14
gyp ERR! stack     at C:\Users\<scrubbed_user>\AppData\Local\atom\app-1.58.0\resources\app\apm\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:372:16
gyp ERR! stack     at C:\Users\<scrubbed_user>\AppData\Local\atom\app-1.58.0\resources\app\apm\node_modules\npm\node_modules\node-gyp\lib\util.js:54:7
gyp ERR! stack     at C:\Users\<scrubbed_user>\AppData\Local\atom\app-1.58.0\resources\app\apm\node_modules\npm\node_modules\node-gyp\lib\util.js:33:16
gyp ERR! stack     at ChildProcess.exithandler (child_process.js:302:5)
gyp ERR! stack     at ChildProcess.emit (events.js:223:5)
gyp ERR! stack     at maybeClose (internal/child_process.js:1021:16)
gyp ERR! System Windows_NT 10.0.19043
gyp ERR! command "C:\\Users\\<scrubbed_user>\\AppData\\Local\\atom\\app-1.58.0\\resources\\app\\apm\\bin\\node.exe" "C:\\Users\\<scrubbed_user>\\AppData\\Local\\atom\\app-1.58.0\\resources\\app\\apm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\<scrubbed_user>\AppData\Local\Temp\apm-install-dir-202171-25672-6nzlmp.jnbkb\node_modules\lang-gdscript\node_modules\tree-sitter-gdscript
gyp ERR! node -v v12.14.1
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok 
npm WARN enoent ENOENT: no such file or directory, open 'C:\Users\<scrubbed_user>\AppData\Local\Temp\apm-install-dir-202171-25672-6nzlmp.jnbkb\package.json'
npm WARN apm-install-dir-202171-25672-6nzlmp.jnbkb No description
npm WARN apm-install-dir-202171-25672-6nzlmp.jnbkb No repository field.
npm WARN apm-install-dir-202171-25672-6nzlmp.jnbkb No README data
npm WARN apm-install-dir-202171-25672-6nzlmp.jnbkb No license field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! tree-sitter-gdscript@1.1.0 install: `prebuild-install || node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the tree-sitter-gdscript@1.1.0 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\<scrubbed_user>\.atom\.apm\_logs\2021-08-01T14_29_31_772Z-debug.log

I pulled the last little bit out of the *debug.log file and it is below:

2562 warn enoent ENOENT: no such file or directory, open 'C:\Users\<scrubbed_user>\AppData\Local\Temp\apm-install-dir-202171-27488-n1ib2y.s08w\package.json'
2563 verbose enoent This is related to npm not being able to find a file.
2564 warn apm-install-dir-202171-27488-n1ib2y.s08w No description
2565 warn apm-install-dir-202171-27488-n1ib2y.s08w No repository field.
2566 warn apm-install-dir-202171-27488-n1ib2y.s08w No README data
2567 warn apm-install-dir-202171-27488-n1ib2y.s08w No license field.
2568 verbose stack Error: tree-sitter-gdscript@1.1.0 install: `prebuild-install || node-gyp rebuild`
2568 verbose stack Exit status 1
2568 verbose stack     at EventEmitter.<anonymous> (C:\Users\<scrubbed_user>\AppData\Local\atom\app-1.58.0\resources\app\apm\node_modules\npm\node_modules\npm-lifecycle\index.js:332:16)
2568 verbose stack     at EventEmitter.emit (events.js:223:5)
2568 verbose stack     at ChildProcess.<anonymous> (C:\Users\<scrubbed_user>\AppData\Local\atom\app-1.58.0\resources\app\apm\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
2568 verbose stack     at ChildProcess.emit (events.js:223:5)
2568 verbose stack     at maybeClose (internal/child_process.js:1021:16)
2568 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
2569 verbose pkgid tree-sitter-gdscript@1.1.0
2570 verbose cwd C:\Users\<scrubbed_user>\AppData\Local\Temp\apm-install-dir-202171-27488-n1ib2y.s08w
2571 verbose Windows_NT 10.0.19043
2572 verbose argv "C:\\Users\\<scrubbed_user>\\AppData\\Local\\atom\\app-1.58.0\\resources\\app\\apm\\bin\\node.exe" "C:\\Users\\<scrubbed_user>\\AppData\\Local\\atom\\app-1.58.0\\resources\\app\\apm\\node_modules\\npm\\bin\\npm-cli.js" "--globalconfig" "C:\\Users\\<scrubbed_user>\\.atom\\.apm\\.apmrc" "--userconfig" "C:\\Users\\<scrubbed_user>\\.atom\\.apmrc" "install" "https://www.atom.io/api/packages/lang-gdscript/versions/6.2.0/tarball" "--target=9.4.4" "--disturl=https://atom.io/download/electron" "--arch=x64" "--global-style"
2573 verbose node v12.14.1
2574 verbose npm  v6.14.13
2575 error code ELIFECYCLE
2576 error errno 1
2577 error tree-sitter-gdscript@1.1.0 install: `prebuild-install || node-gyp rebuild`
2577 error Exit status 1
2578 error Failed at the tree-sitter-gdscript@1.1.0 install script.
2578 error This is probably not a problem with npm. There is likely additional logging output above.
2579 verbose exit [ 1, true ]
dirigonaut commented 3 years ago

Okay so I just hunkered down and did a bunch of research. I installed visual studio 2019 community edition making it a point to install a bunch of C++ packages for node-gyp via the visual studio installer. This appears to have fixed my issue. It looks like @RaykWashington is on visual studio 2017 I do not know if the update of visual studio will help as it looks like it was a compile issue for you versus the missing dependency for me.

@PrestonKnopp it might be worth calling out that due to the dependencies on tree-sitter-gdscript and tree-sitter-godot-resource, which I assume are C++ libraries due to needing node-gyp, you will need to install visual studio for windows specifically otherwise they will not build properly. Thanks again for building and maintaining this package.

RailKill commented 2 years ago

As @dirigonaut mentioned, this issue is resolved with Visual Studio 2019 Build Tools. The NodeJS Windows installer comes with the 2017 version and will have problems running node-gyp rebuild. I have faced this issue on other packages as well, but it's worth mentioning this in the README or description.

@RaykWashington I solved this issue by uninstalling 2017 build tools, installing 2019 with Visual C++, and making sure node-gyp is the latest version in npm. My 2017 build tools came with the NodeJS Windows installer, which means it was installed with Chocolatey. Here are the steps:

  1. Run Windows PowerShell as Administrator.
  2. choco uninstall visualstudio2017-workload-vctools to uninstall Visual C++ 2017.
  3. choco uninstall visualstudio2017buildtools to uninstall Visual Studio 2017 Build Tools.
  4. choco install visualstudio2019buildtools to install Visual Studio 2019 Build Tools.
  5. choco install visualstudio2019-workload-vctools to install Visual C++ 2019.
  6. npm install -g node-gyp to ensure the latest version is installed globally for all users.

If it wasn't installed with Chocolatey, then just uninstall it manually via Add or Remove Programs, then download and run the 2019 installer here.

RaykWashington commented 2 years ago

Thanks @RailKill and @dirigonaut , installing 2019 did the trick.