node-gyp
node-gyp copied to clipboard
node-gyp rebuild error
Please look thru your error log for the string gyp info using node-gyp@
and if the version number is less than the current release of node-gyp then please upgrade using the instructions at https://github.com/nodejs/node-gyp/blob/master/docs/Updating-npm-bundled-node-gyp.md and try your command again.
Requests for help with node-sass
are very common. Please be aware that this package is deprecated, you should seek alternatives and avoid opening new issues about it here.
- Node Version: node v12.16.1 npm 6.13.7
- Platform: window7 [email protected]
- Compiler:
- Module: When i use node-gyp rebuild error .
gyp ERR! find VS gyp ERR! find VS msvs_version was set from command line or npm config gyp ERR! find VS - looking for Visual Studio version 2017 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 valid versions for msvs_version: 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 (D:\nodejs\node_global\node_module s\npm\node_modules\node-gyp\lib\find-visualstudio.js:121:47) gyp ERR! stack at D:\nodejs\node_global\node_modules\npm\node_modules\node-g yp\lib\find-visualstudio.js:74:16 gyp ERR! stack at VisualStudioFinder.findVisualStudio2013 (D:\nodejs\node_gl obal\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:351:14) gyp ERR! stack at D:\nodejs\node_global\node_modules\npm\node_modules\node-g yp\lib\find-visualstudio.js:70:14 gyp ERR! stack at D:\nodejs\node_global\node_modules\npm\node_modules\node-g yp\lib\find-visualstudio.js:372:16 gyp ERR! stack at D:\nodejs\node_global\node_modules\npm\node_modules\node-g yp\lib\util.js:54:7 gyp ERR! stack at D:\nodejs\node_global\node_modules\npm\node_modules\node-g yp\lib\util.js:33:16 gyp ERR! stack at ChildProcess.exithandler (child_process.js:310:5) gyp ERR! stack at ChildProcess.emit (events.js:311:20) gyp ERR! stack at maybeClose (internal/child_process.js:1021:16) gyp ERR! System Windows_NT 6.1.7601 gyp ERR! command "D:\nodejs\node.exe" "D:\nodejs\node_global\node_modules\ npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild" gyp ERR! cwd E:\work\Steam\node_modules\greenworks gyp ERR! node -v v12.16.1 gyp ERR! node-gyp -v v8.4.1 gyp ERR! not ok npm ERR! code ELIFECYCLE
Then I try --loglevel silly
gyp sill find Python execFile result: err = null
gyp sill find Python execFile result: stdout = "3.8.10\r\n"
gyp sill find Python execFile result: stderr = ""
gyp verb find Python - version is "3.8.10"
gyp info find Python using Python version 3.8.10 found at "D:\py38\python.exe"
gyp verb get node dir no --target version specified, falling back to host node v
ersion: 12.16.1
gyp verb command install [ '12.16.1' ]
gyp verb install input version string "12.16.1"
gyp verb install installing version: 12.16.1
gyp verb install --ensure was passed, so won't reinstall if already installed
gyp verb install version is already installed, need to check "installVersion"
gyp verb got "installVersion" 9
gyp verb needs "installVersion" 9
gyp verb install version is good
gyp verb get node dir target node version installed: 12.16.1
gyp verb build dir attempting to create "build" dir: E:\work\Steam\node_modules
greenworks\build
gyp verb build dir "build" dir needed to be created? No
gyp verb find VS msvs_version was set from command line or npm config
gyp verb find VS - looking for Visual Studio version 2017
gyp verb find VS VCINSTALLDIR not set, not running in VS Command Prompt
gyp sill find VS Running C:\Windows\System32\WindowsPowerShell\v1.0\powershell.e
xe [
gyp sill find VS '-ExecutionPolicy',
gyp sill find VS 'Unrestricted',
gyp sill find VS '-NoProfile',
gyp sill find VS '-Command',
gyp sill find VS "&{Add-Type -Path 'D:\nodejs\node_global\node_modules\nod
e-gyp\lib\Find-VisualStudio.cs';[VisualStudioConfiguration.Main]::PrintJson()}
"
gyp sill find VS ]
gyp sill find VS PS stderr = "Add-Type : ��������ֵ��еĹؼ���:��npm_config_chrom
edriver_cdnurl�������ӵ�\r\n�ؼ���:��npm_config_chromedriver_cdnurl��\r\n����λ��
��:1 �ַ�: 11\r\n+ &{Add-Type <<<< -Path 'D:\nodejs\node_global\node_modules
\node-gyp\lib\Find-\r\nVisualStudio.cs';[VisualStudioConfiguration.Main]::Prin
tJson()}\r\n + CategoryInfo : NotSpecified: (:) [Add-Type], Argument
Exception\r\n + FullyQualifiedErrorId : System.ArgumentException,Microsoft.Po
werShell.Co \r\n mmands.AddTypeCommand\r\n \r\n�Ҳ������� [VisualStudioConfigur
ation.Main]: ��ȷ���Ѽ��ذ��������͵ij����\r\n����λ�� ��:1 �ַ�: 121\r\n+ &{Add-Type
-Path 'D:\nodejs\node_global\node_modules\node-gyp\lib\Find-Visual\r\nStud
io.cs';[VisualStudioConfiguration.Main] <<<< ::PrintJson()}\r\n + CategoryInf
o : InvalidOperation: (VisualStudioConfiguration.Mai \r\n n:String) [
], RuntimeException\r\n + FullyQualifiedErrorId : TypeNotFound\r\n \r\n"
gyp sill find VS PS stdout = ""
gyp sill find VS SyntaxError: Unexpected end of JSON input
gyp sill find VS at JSON.parse (
gyp sill find VS ' at Process.ChildProcess._handle.onexit (internal/child _process.js:286:5)' gyp sill find VS } gyp verb find VS could not use PowerShell to find Visual Studio 2017 or newer, t ry re-running with '--loglevel silly' for more details
In cmd
, did you do npm config set msvs_version 2017
?
@cclauss I did it but it didn't work
SyntaxError: Unexpected end of JSON input
like #2388
Stumped on this one as well, and I tried the steps listed here, as well as checking PATH settings and multiple versions of VS/MSBUILD
npm ERR! code 1
npm ERR! path C:_my_git\rei\interview-exercise-SeanGephardt1\node_modules\node-sass
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c node scripts/build.js
npm ERR! Building: C:\Program Files\nodejs\node.exe C:_my_git\rei\interview-exercise-SeanGephardt1\node_modules\node-gyp\bin\node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp verb cli [
npm ERR! gyp verb cli 'C:\Program Files\nodejs\node.exe',
npm ERR! gyp verb cli 'C:\_my_git\rei\interview-exercise-SeanGephardt1\node_modules\node-gyp\bin\node-gyp.js',
npm ERR! gyp verb cli 'rebuild',
npm ERR! gyp verb cli '--verbose',
npm ERR! gyp verb cli '--libsass_ext=',
npm ERR! gyp verb cli '--libsass_cflags=',
npm ERR! gyp verb cli '--libsass_ldflags=',
npm ERR! gyp verb cli '--libsass_library='
npm ERR! gyp verb cli ]
npm ERR! gyp info using [email protected]
npm ERR! gyp info using [email protected] | win32 | x64
npm ERR! gyp verb command rebuild []
npm ERR! gyp verb command clean []
npm ERR! gyp verb clean removing "build" directory
npm ERR! gyp verb command configure []
npm ERR! gyp verb check python checking for Python executable "C:\Python27\python.exe" in the PATH
npm ERR! gyp verb which
succeeded C:\Python27\python.exe C:\Python27\python.exe
npm ERR! gyp verb check python version C:\Python27\python.exe -c "import sys; print "2.7.18 npm ERR! gyp verb check python version .%s.%s" % sys.version_info[:3];"
returned: %j
npm ERR! gyp verb get node dir no --target version specified, falling back to host node version: 16.13.1
npm ERR! gyp verb command install [ '16.13.1' ]
npm ERR! gyp verb install input version string "16.13.1"
npm ERR! gyp verb install installing version: 16.13.1
npm ERR! gyp verb install --ensure was passed, so won't reinstall if already installed
npm ERR! gyp verb install version is already installed, need to check "installVersion"
npm ERR! gyp verb got "installVersion" 9
npm ERR! gyp verb needs "installVersion" 9
npm ERR! gyp verb install version is good
npm ERR! gyp verb get node dir target node version installed: 16.13.1
npm ERR! gyp verb build dir attempting to create "build" dir: C:_my_git\rei\interview-exercise-SeanGephardt1\node_modules\node-sass\build
npm ERR! gyp verb build dir "build" dir needed to be created? C:_my_git\rei\interview-exercise-SeanGephardt1\node_modules\node-sass\build
npm ERR! gyp verb find vs2017 Found installation at: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community
npm ERR! gyp verb find vs2017 - Found Microsoft.VisualStudio.Component.Windows10SDK.19041
npm ERR! gyp verb find vs2017 - Found Microsoft.VisualStudio.Component.VC.Tools.x86.x64
npm ERR! gyp verb find vs2017 - Found Microsoft.VisualStudio.VC.MSBuild.Base
npm ERR! gyp verb find vs2017 - Using this installation with Windows 10 SDK
npm ERR! gyp verb find vs2017 using installation: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community
npm ERR! gyp verb build/config.gypi creating config file
npm ERR! gyp verb build/config.gypi writing out config file: C:_my_git\rei\interview-exercise-SeanGephardt1\node_modules\node-sass\build\config.gypi
npm ERR! (node:4724) [DEP0150] DeprecationWarning: Setting process.config is deprecated. In the future the property will be read-only.
npm ERR! (Use node --trace-deprecation ...
to show where the warning was created)
npm ERR! gyp verb config.gypi checking for gypi file: C:_my_git\rei\interview-exercise-SeanGephardt1\node_modules\node-sass\config.gypi
npm ERR! gyp verb common.gypi checking for gypi file: C:_my_git\rei\interview-exercise-SeanGephardt1\node_modules\node-sass\common.gypi
npm ERR! gyp verb gyp gyp format was not specified; forcing "msvs"
npm ERR! gyp info spawn C:\Python27\python.exe
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args 'C:\_my_git\rei\interview-exercise-SeanGephardt1\node_modules\node-gyp\gyp\gyp_main.py',
npm ERR! gyp info spawn args 'binding.gyp',
npm ERR! gyp info spawn args '-f',
npm ERR! gyp info spawn args 'msvs',
npm ERR! gyp info spawn args '-G',
npm ERR! gyp info spawn args 'msvs_version=2015',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args 'C:\_my_git\rei\interview-exercise-SeanGephardt1\node_modules\node-sass\build\config.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args 'C:\_my_git\rei\interview-exercise-SeanGephardt1\node_modules\node-gyp\addon.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args 'C:\Users\seang\.node-gyp\16.13.1\include\node\common.gypi',
npm ERR! gyp info spawn args '-Dlibrary=shared_library',
npm ERR! gyp info spawn args '-Dvisibility=default',
npm ERR! gyp info spawn args '-Dnode_root_dir=C:\Users\seang\.node-gyp\16.13.1',
npm ERR! gyp info spawn args '-Dnode_gyp_dir=C:\_my_git\rei\interview-exercise-SeanGephardt1\node_modules\node-gyp',
npm ERR! gyp info spawn args '-Dnode_lib_file=C:\Users\seang\.node-gyp\16.13.1\<(target_arch)\node.lib',
npm ERR! gyp info spawn args '-Dmodule_root_dir=C:\_my_git\rei\interview-exercise-SeanGephardt1\node_modules\node-sass',
npm ERR! gyp info spawn args '-Dnode_engine=v8',
npm ERR! gyp info spawn args '--depth=.',
npm ERR! gyp info spawn args '--no-parallel',
npm ERR! gyp info spawn args '--generator-output',
npm ERR! gyp info spawn args 'C:\_my_git\rei\interview-exercise-SeanGephardt1\node_modules\node-sass\build',
npm ERR! gyp info spawn args '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! gyp verb command build []
npm ERR! gyp verb build type Release
npm ERR! gyp verb architecture x64
npm ERR! gyp verb node dev dir C:\Users\seang.node-gyp\16.13.1
npm ERR! gyp verb found first Solution file build/binding.sln
npm ERR! gyp verb using MSBuild: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\15.0\Bin\MSBuild.exe
npm ERR! gyp info spawn C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\15.0\Bin\MSBuild.exe
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args 'build/binding.sln',
npm ERR! gyp info spawn args '/nologo',
npm ERR! gyp info spawn args '/p:Configuration=Release;Platform=x64'
npm ERR! gyp info spawn args ]
npm ERR! gyp ERR! UNCAUGHT EXCEPTION
npm ERR! gyp ERR! stack Error: spawn C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\15.0\Bin\MSBuild.exe ENOENT
npm ERR! gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:282:19)
npm ERR! gyp ERR! stack at onErrorNT (node:internal/child_process:477:16)
npm ERR! gyp ERR! stack at processTicksAndRejections (node:internal/process/task_queues:83:21)
npm ERR! gyp ERR! System Windows_NT 10.0.22523
npm ERR! gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\_my_git\rei\interview-exercise-SeanGephardt1\node_modules\node-gyp\bin\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
npm ERR! gyp ERR! cwd C:_my_git\rei\interview-exercise-SeanGephardt1\node_modules\node-sass
npm ERR! gyp ERR! node -v v16.13.1
npm ERR! gyp ERR! node-gyp -v v3.8.0
npm ERR! gyp ERR! This is a bug in node-gyp
.
npm ERR! gyp ERR! Try to update node-gyp and file an Issue if it does not help:
npm ERR! gyp ERR! https://github.com/nodejs/node-gyp/issues
npm ERR! Build failed with error code: 7
npm ERR! A complete log of this run can be found in:
npm ERR! gyp info using [email protected]
Current version is 8, not 3!
Plus deprecated node-sass. https://github.com/nodejs/node-gyp/tree/master/docs#readme
Go and download the 2017 vs code and install the desktop tools it should work i just fixed mine. just a quick google..
I am trying to install nodobjc to use AppKit to find the screen widths and heights of the screens I am using. I put it in my dependencies in package.json but when I ran this command: npm install electron-rebuild --save-dev
, I got the following node-gyp error. Any help is greatly appreciated - I am new to this all.
npm ERR! CXX(target) Release/obj.target/binding/src/binding.o
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using [email protected]
npm ERR! gyp info using [email protected] | darwin | x64
npm ERR! gyp info find Python using Python version 3.9.5 found at "/Users/fats/opt/miniconda3/bin/python3"
npm ERR! gyp http GET https://nodejs.org/download/release/v17.6.0/node-v17.6.0-headers.tar.gz
npm ERR! gyp http 200 https://nodejs.org/download/release/v17.6.0/node-v17.6.0-headers.tar.gz
npm ERR! gyp http GET https://nodejs.org/download/release/v17.6.0/SHASUMS256.txt
npm ERR! gyp http 200 https://nodejs.org/download/release/v17.6.0/SHASUMS256.txt
npm ERR! gyp info spawn /Users/fats/opt/miniconda3/bin/python3
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args '/Users/fats/Documents/Project/version2.0_mac/gui/node_modules/node-gyp/gyp/gyp_main.py',
npm ERR! gyp info spawn args 'binding.gyp',
npm ERR! gyp info spawn args '-f',
npm ERR! gyp info spawn args 'make',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/Users/fats/Documents/Project/version2.0_mac/gui/node_modules/ref/build/config.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/Users/fats/Documents/Project/version2.0_mac/gui/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/Users/fats/Library/Caches/node-gyp/17.6.0/include/node/common.gypi',
npm ERR! gyp info spawn args '-Dlibrary=shared_library',
npm ERR! gyp info spawn args '-Dvisibility=default',
npm ERR! gyp info spawn args '-Dnode_root_dir=/Users/fats/Library/Caches/node-gyp/17.6.0',
npm ERR! gyp info spawn args '-Dnode_gyp_dir=/Users/fats/Documents/Project/version2.0_mac/gui/node_modules/node-gyp',
npm ERR! gyp info spawn args '-Dnode_lib_file=/Users/fats/Library/Caches/node-gyp/17.6.0/<(target_arch)/node.lib',
npm ERR! gyp info spawn args '-Dmodule_root_dir=/Users/fats/Documents/Project/version2.0_mac/gui/node_modules/ref',
npm ERR! gyp info spawn args '-Dnode_engine=v8',
npm ERR! gyp info spawn args '--depth=.',
npm ERR! gyp info spawn args '--no-parallel',
npm ERR! gyp info spawn args '--generator-output',
npm ERR! gyp info spawn args 'build',
npm ERR! gyp info spawn args '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! gyp info spawn make
npm ERR! gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
npm ERR! ../src/binding.cc:222:43: error: too few arguments to function call, single argument 'isolate' was not specified
npm ERR! bool persistent = info[3]->BooleanValue();
npm ERR! ~~~~~~~~~~~~~~~~~~~~~ ^
npm ERR! /Users/fats/Library/Caches/node-gyp/17.6.0/include/node/v8-value.h:408:8: note: 'BooleanValue' declared here
npm ERR! bool BooleanValue(Isolate* isolate) const;
npm ERR! ^
npm ERR! ../src/binding.cc:253:38: error: too few arguments to function call, single argument 'context' was not specified
npm ERR! size_t size = info[2]->Uint32Value();
npm ERR! ~~~~~~~~~~~~~~~~~~~~ ^
npm ERR! /Users/fats/Library/Caches/node-gyp/17.6.0/include/node/v8-value.h:416:41: note: 'Uint32Value' declared here
npm ERR! V8_WARN_UNUSED_RESULT Maybe<uint32_t> Uint32Value(
npm ERR! ^
npm ERR! ../src/binding.cc:253:10: error: no viable conversion from 'Maybe<uint32_t>' (aka 'Maybemake
failed with exit code: 2
This issue seems no longer relevant as it uses a no longer supported version of Node and has been stale for a long time. If there are no objections, I will close this issue next Mon-Tue. In case something similar happens again please open a new issue.