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

MSBuild.exe ENOENT - uses VS2019 instead of VS2017 #1747

Closed
EmailDE opened this issue May 9, 2019 · 17 comments
Closed

MSBuild.exe ENOENT - uses VS2019 instead of VS2017 #1747

EmailDE opened this issue May 9, 2019 · 17 comments
Labels
ERR! node-gyp -v < v10.x.x npm install -g npm Node Sass --> Dart Sass https://github.com/sass/node-sass/issues/2952

Comments

@EmailDE
Copy link

EmailDE commented May 9, 2019

  • Node Version: node v11.14.0, npm 6.7.0
  • Platform: Microsoft Windows 10 Pro 10.0.17134 x64-based PC
  • Module: npm install node-expat // node-gyp rebuild
Verbose output (from npm or node-gyp):
$ npm install node-expat --verbose
npm info it worked if it ends with ok
npm verb cli [ 'C:\\Program Files\\nodejs\\node.exe',
npm verb cli   'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
npm verb cli   'install',
npm verb cli   'node-expat',
npm verb cli   '--verbose' ]
npm info using [email protected]
npm info using [email protected]
npm verb npm-session 7b9b925b92d87a26
npm http fetch GET 304 https://registry.npmjs.org/node-expat 192ms (from cache)
npm timing stage:loadCurrentTree Completed in 237ms
npm timing stage:loadIdealTree:cloneCurrentTree Completed in 0ms
npm timing stage:loadIdealTree:loadShrinkwrap Completed in 7ms
npm http fetch GET 304 https://registry.npmjs.org/bindings 50ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/nan 103ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/file-uri-to-path 50ms (from cache)
npm timing stage:loadIdealTree:loadAllDepsIntoIdealTree Completed in 166ms
npm timing stage:loadIdealTree Completed in 178ms
npm timing stage:generateActionsToTake Completed in 4ms
npm verb correctMkdir C:\Users\emil\AppData\Roaming\npm-cache\_locks correctMkdir not in flight; initializing
npm verb lock using C:\Users\emil\AppData\Roaming\npm-cache\_locks\staging-52648016cd19f6c3.lock for E:\game\engine\node_modules\.staging
npm timing audit submit Completed in 476ms
npm http fetch POST 200 https://registry.npmjs.org/-/npm/v1/security/audits/quick 476ms
npm timing audit body Completed in 1ms
npm timing action:extract Completed in 759ms
npm timing action:finalize Completed in 6ms
npm timing action:refresh-package-json Completed in 48ms
npm info lifecycle [email protected]~preinstall: [email protected]
npm info lifecycle [email protected]~preinstall: [email protected]
npm info lifecycle [email protected]~preinstall: [email protected]
npm info lifecycle [email protected]~preinstall: [email protected]
npm timing action:preinstall Completed in 2ms
npm info linkStuff [email protected]
npm info linkStuff [email protected]
npm info linkStuff [email protected]
npm info linkStuff [email protected]
npm timing action:build Completed in 3ms
npm info lifecycle [email protected]~install: [email protected]
npm info lifecycle [email protected]~install: [email protected]
npm info lifecycle [email protected]~install: [email protected]
npm info lifecycle [email protected]~install: [email protected]

> [email protected] install E:\game\engine\node_modules\node-expat
> node-gyp rebuild

gyp info it worked if it ends with ok
gyp verb cli [ 'C:\\Program Files\\nodejs\\node.exe',
gyp verb cli   'C:\\Users\\emil\\AppData\\Roaming\\nvm\\v11.14.0\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js',
gyp verb cli   'rebuild' ]
gyp info using [email protected]
gyp info using [email protected] | win32 | x64
gyp verb command rebuild []
gyp verb command clean []
gyp verb clean removing "build" directory
gyp verb command configure []
gyp verb check python checking for Python executable "python2.7" in the PATH
gyp verb `which` failed Error: not found: python2.7
gyp verb `which` failed     at getNotFoundError (C:\Users\emil\AppData\Roaming\nvm\v11.14.0\node_modules\npm\node_modules\which\which.js:13:12)
gyp verb `which` failed     at F (C:\Users\emil\AppData\Roaming\nvm\v11.14.0\node_modules\npm\node_modules\which\which.js:68:19)
gyp verb `which` failed     at E (C:\Users\emil\AppData\Roaming\nvm\v11.14.0\node_modules\npm\node_modules\which\which.js:80:29)
gyp verb `which` failed     at C:\Users\emil\AppData\Roaming\nvm\v11.14.0\node_modules\npm\node_modules\which\which.js:89:16
gyp verb `which` failed     at C:\Users\emil\AppData\Roaming\nvm\v11.14.0\node_modules\npm\node_modules\isexe\index.js:42:5
gyp verb `which` failed     at C:\Users\emil\AppData\Roaming\nvm\v11.14.0\node_modules\npm\node_modules\isexe\windows.js:36:5
gyp verb `which` failed     at FSReqCallback.oncomplete (fs.js:158:21)
gyp verb `which` failed  python2.7 { Error: not found: python2.7
gyp verb `which` failed     at getNotFoundError (C:\Users\emil\AppData\Roaming\nvm\v11.14.0\node_modules\npm\node_modules\which\which.js:13:12)
gyp verb `which` failed     at F (C:\Users\emil\AppData\Roaming\nvm\v11.14.0\node_modules\npm\node_modules\which\which.js:68:19)
gyp verb `which` failed     at E (C:\Users\emil\AppData\Roaming\nvm\v11.14.0\node_modules\npm\node_modules\which\which.js:80:29)
gyp verb `which` failed     at C:\Users\emil\AppData\Roaming\nvm\v11.14.0\node_modules\npm\node_modules\which\which.js:89:16
gyp verb `which` failed     at C:\Users\emil\AppData\Roaming\nvm\v11.14.0\node_modules\npm\node_modules\isexe\index.js:42:5
gyp verb `which` failed     at C:\Users\emil\AppData\Roaming\nvm\v11.14.0\node_modules\npm\node_modules\isexe\windows.js:36:5
gyp verb `which` failed     at FSReqCallback.oncomplete (fs.js:158:21)
gyp verb `which` failed   stack:
gyp verb `which` failed    'Error: not found: python2.7\n    at getNotFoundError (C:\\Users\\emil\\AppData\\Roaming\\nvm\\v11.14.0\\node_modules\\npm\\node_modules\\which\\which.js:13:12)\n
 at F (C:\\Users\\emil\\AppData\\Roaming\\nvm\\v11.14.0\\node_modules\\npm\\node_modules\\which\\which.js:68:19)\n    at E (C:\\Users\\emil\\AppData\\Roaming\\nvm\\v11.14.0\\node_modules\\npm\\node_modules\\which\\which.js:80:29)\n    at C:\\Users\\emil\\AppData\\Roaming\\nvm\\v11.14.0\\node_modules\\npm\\node_modules\\which\\which.js:89:16\n    at C:\\Users\\emil\\AppData\\Roaming\\nvm\\v11.14.0\\node_modules\\npm\\node_modules\\isexe\\index.js:42:5\n    at C:\\Users\\emil\\AppData\\Roaming\\nvm\\v11.14.0\\node_modules\\npm\\node_modules\\isexe\\windows.js:36:5\n    at FSReqCallback.oncomplete (fs.js:158:21)',
gyp verb `which` failed   code: 'ENOENT' }
gyp verb could not find "python2.7". checking python launcher
gyp verb check python launcher python executable found: "C:\\Program Files\\Python2.7\\python.exe"
gyp verb check python version `C:\Program Files\Python2.7\python.exe -c "import sys; print "2.7.16
gyp verb check python version .%s.%s" % sys.version_info[:3];"` returned: %j
gyp verb get node dir no --target version specified, falling back to host node version: 11.14.0
gyp verb command install [ '11.14.0' ]
gyp verb install input version string "11.14.0"
gyp verb install installing version: 11.14.0
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: 11.14.0
gyp verb build dir attempting to create "build" dir: E:\game\engine\node_modules\node-expat\build
gyp verb build dir "build" dir needed to be created? E:\game\engine\node_modules\node-expat\build
gyp verb find vs2017 Found installation at: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community
gyp verb find vs2017   - Found Microsoft.VisualStudio.Component.Windows10SDK.17763
gyp verb find vs2017   - Found Microsoft.VisualStudio.Component.VC.Tools.x86.x64
gyp verb find vs2017   - Found Microsoft.VisualStudio.VC.MSBuild.Base
gyp verb find vs2017   - Using this installation with Windows 10 SDK
gyp verb find vs2017 using installation: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community
gyp verb build/config.gypi creating config file
gyp verb build/config.gypi writing out config file: E:\game\engine\node_modules\node-expat\build\config.gypi
gyp verb config.gypi checking for gypi file: E:\game\engine\node_modules\node-expat\config.gypi
gyp verb common.gypi checking for gypi file: E:\game\engine\node_modules\node-expat\common.gypi
gyp verb gyp gyp format was not specified; forcing "msvs"
gyp info spawn C:\Program Files\Python2.7\python.exe
gyp info spawn args [ 'C:\\Users\\emil\\AppData\\Roaming\\nvm\\v11.14.0\\node_modules\\npm\\node_modules\\node-gyp\\gyp\\gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'msvs',
gyp info spawn args   '-G',
gyp info spawn args   'msvs_version=2015',
gyp info spawn args   '-I',
gyp info spawn args   'E:\\game\\engine\\node_modules\\node-expat\\build\\config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Users\\emil\\AppData\\Roaming\\nvm\\v11.14.0\\node_modules\\npm\\node_modules\\node-gyp\\addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Users\\emil\\.node-gyp\\11.14.0\\include\\node\\common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=C:\\Users\\emil\\.node-gyp\\11.14.0',
gyp info spawn args   '-Dnode_gyp_dir=C:\\Users\\emil\\AppData\\Roaming\\nvm\\v11.14.0\\node_modules\\npm\\node_modules\\node-gyp',
gyp info spawn args   '-Dnode_lib_file=C:\\Users\\emil\\.node-gyp\\11.14.0\\<(target_arch)\\node.lib',
gyp info spawn args   '-Dmodule_root_dir=E:\\game\\engine\\node_modules\\node-expat',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'E:\\game\\engine\\node_modules\\node-expat\\build',
gyp info spawn args   '-Goutput_dir=.' ]
Warning: Missing input files:
E:\game\engine\node_modules\node-expat\build\deps\libexpat\..\..\..\deps\libexpat\version.c
gyp verb command build []
gyp verb build type Release
gyp verb architecture x64
gyp verb node dev dir C:\Users\emil\.node-gyp\11.14.0
gyp verb found first Solution file build/binding.sln
gyp verb using MSBuild: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\15.0\Bin\MSBuild.exe
gyp info spawn C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\15.0\Bin\MSBuild.exe
gyp info spawn args [ 'build/binding.sln',
gyp info spawn args   '/nologo',
gyp info spawn args   '/p:Configuration=Release;Platform=x64' ]
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:247:19)
gyp ERR! stack     at onErrorNT (internal/child_process.js:429:16)
gyp ERR! stack     at processTicksAndRejections (internal/process/task_queues.js:81:17)
gyp ERR! System Windows_NT 10.0.17134
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\emil\\AppData\\Roaming\\nvm\\v11.14.0\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd E:\game\engine\node_modules\node-expat
gyp ERR! node -v v11.14.0
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://github.com/nodejs/node-gyp/issues>
npm verb lifecycle [email protected]~install: unsafe-perm in lifecycle true
npm verb lifecycle [email protected]~install: PATH: C:\Users\emil\AppData\Roaming\nvm\v11.14.0\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;E:\game\engine\node_modules\node-expat\node_modules\.bin;E:\game\engine\node_modules\.bin;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;C:\Users\emil\bin;C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\intel64\compiler;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Program Files\Intel\WiFi\bin;C:\Program Files\Common Files\Intel\WirelessCommon;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\WINDOWS\System32\OpenSSH;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Users\emil\AppData\Roaming\nvm;C:\Program Files\dotnet;C:\Program Files\Git\cmd;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\Microsoft SQL Server\130\Tools\Binn;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn;C:\Users\emil\AppData\Roaming\nvm;C:\Program Files\nodejs;C:\Program Files (x86)\Yarn\bin;C:\Users\emil\.windows-build-tools\python27;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;C:\Users\emil\bin;C:\Users\emil\AppData\Roaming\nvm\v11.14.0\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Program Files\nodejs\node_modules\windows-build-tools\node_modules\.bin;C:\Program Files\nodejs\node_modules\.bin;C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\intel64\compiler;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Program Files\Intel\WiFi\bin;C:\Program Files\Common Files\Intel\WirelessCommon;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\WINDOWS\System32\OpenSSH;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Users\emil\AppData\Roaming\nvm;C:\Program Files\dotnet;C:\Program Files\Git\cmd;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\Microsoft SQL Server\130\Tools\Binn;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn;C:\Users\emil\AppData\Roaming\nvm;C:\Program Files\nodejs;C:\Program Files (x86)\Yarn\bin;C:\Users\emil\AppData\Local\Microsoft\WindowsApps;C:\Users\emil\AppData\Local\Programs\Microsoft VS Code\bin;C:\Program Files\nodejs;C:\Users\emil\AppData\Roaming\npm;C:\Users\emil\AppData\Local\Yarn\bin
npm verb lifecycle [email protected]~install: CWD: E:\game\engine\node_modules\node-expat
npm info lifecycle [email protected]~install: Failed to exec install script
npm timing action:install Completed in 1518ms
npm verb unlock done using C:\Users\emil\AppData\Roaming\npm-cache\_locks\staging-52648016cd19f6c3.lock for E:\game\engine\node_modules\.staging
npm timing stage:rollbackFailedOptional Completed in 27ms
npm timing stage:runTopLevelLifecycles Completed in 2800ms
npm WARN [email protected] No repository field.

npm verb stack Error: [email protected] install: `node-gyp rebuild`
npm verb stack Exit status 7
npm verb stack     at EventEmitter.<anonymous> (C:\Users\emil\AppData\Roaming\nvm\v11.14.0\node_modules\npm\node_modules\npm-lifecycle\index.js:301:16)
npm verb stack     at EventEmitter.emit (events.js:193:13)
npm verb stack     at ChildProcess.<anonymous> (C:\Users\emil\AppData\Roaming\nvm\v11.14.0\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
npm verb stack     at ChildProcess.emit (events.js:193:13)
npm verb stack     at maybeClose (internal/child_process.js:999:16)
npm verb stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:266:5)
npm verb pkgid [email protected]
npm verb cwd E:\game\engine
npm verb Windows_NT 10.0.17134
npm verb argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "node-expat" "--verbose"
npm verb node v11.14.0
npm verb npm  v6.7.0
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 verb exit [ 7, true ]
npm timing npm Completed in 3237ms

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\emil\AppData\Roaming\npm-cache\_logs\2019-05-09T16_27_17_130Z-debug.log
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

C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\15.0\Bin\ does not contain MSBuild.exe, but C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\ does. Why does it use 2019? How can I configure node-gyp's MSBuild path?

@EmailDE
Copy link
Author

EmailDE commented May 9, 2019

set npm_config_msvs_version=2017 and npm install node-expat produces the same error.

@EmailDE
Copy link
Author

EmailDE commented May 9, 2019

same error with npm config set msvs_version 2017 -g

@EmailDE
Copy link
Author

EmailDE commented May 9, 2019

uninstalling vs 2019 as aworkaround worked for me but it doesnt solve the problem

@kgiannelos
Copy link

This stackoverflow article is what helped me get over this, without having to uninstall VS 2019.
https://stackoverflow.com/questions/33896511/npm-install-fails-with-node-gyp

I already had python 2.7 installed on my system, so the only thing I had to do in adition was to install Visual C++ Build tools from here, https://go.microsoft.com/fwlink/?LinkId=691126, and then configure npm to use python 2.7 and VS2015

  1. npm config set python python2.7
  2. npm config set msvs_version 2015

After that, npm install run just fine.

@EmailDE EmailDE closed this as completed May 13, 2019
@JarLob
Copy link

JarLob commented May 28, 2019

npm config set msvs_version 2015 was enough to do the trick in my case. I also have VS2019. I didn't have to install the tools since I have full VS2015 installed too.

@joaocgreis
Copy link
Member

joaocgreis commented Jun 14, 2019

node-gyp v5.0.0 is out with Visual Studio 2019 support. It's not yet integrated into npm so it has to be installed manually. This should do it (only need to be run once):

Windows Command Prompt
npm install --global node-gyp@latest
for /f "delims=" %P in ('npm prefix -g') do npm config set node_gyp "%P\node_modules\node-gyp\bin\node-gyp.js"

Powershell
npm install --global node-gyp@latest
npm prefix -g | % {npm config set node_gyp "$_\node_modules\node-gyp\bin\node-gyp.js"}


That is, install node-gyp globally and make the npm config variable node_gyp point to node-gyp.js.

How to undo this after node-gyp is integrated into npm
npm uninstall --global node-gyp
npm config delete node_gyp

@EbubeUd
Copy link

EbubeUd commented Nov 6, 2019

npm config set msvs_version 2017

@is0xb
Copy link

is0xb commented Nov 18, 2019

npm install --global --production windows-build-tools --vs2017
may work well

@franscal7
Copy link

In my case the error was caused by @angular-devkit/[email protected] that depends on [email protected], which depends on [email protected], and the latter is the one who generates the error.

I solved it by updating the version of @angular-devkit/build-angular to the latest version

@Jagadesh-Ram
Copy link

Guys i have was facing this issue for an entire day at my work, just now solved by just copy pasting the MSBuild.exe file in C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\MSBuild\Current\Bin to C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\MSBuild\15.0\Bin.

I tried all the suggested methods in this thread none worked. If anyone happened to face this issue straight away use npm install --global --production windows-build-tools --vs2019 or --vs2017 .
and copy paste the exe file.

@liudonghua123
Copy link

I have also the following errors.

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:268:19)
gyp ERR! stack     at onErrorNT (internal/child_process.js:468:16)
gyp ERR! stack     at processTicksAndRejections (internal/process/task_queues.js:84:21)
gyp ERR! System Windows_NT 10.0.18363
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "D:\\code\\java\\rots\\ant-design-vue-jeecg\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd D:\code\java\rots\ant-design-vue-jeecg\node_modules\node-sass
gyp ERR! node -v v14.0.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! This is a bug in `node-gyp`.


C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\15.0\Bin>dir
 Volume in drive C has no label.
 Volume Serial Number is AAA1-A798

 Directory of C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\15.0\Bin

2020-04-18  10:31    <DIR>          .
2020-04-18  10:31    <DIR>          ..
2020-04-18  10:31    <DIR>          Roslyn
               0 File(s)              0 bytes
               3 Dir(s)   6,542,876,672 bytes free

C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\15.0\Bin>cd ..\..\Current\Bin

C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin>dir MSBuild.exe
 Volume in drive C has no label.
 Volume Serial Number is AAA1-A798

 Directory of C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin

2020-04-18  10:28           313,424 MSBuild.exe
               1 File(s)        313,424 bytes
               0 Dir(s)   6,542,188,544 bytes free

C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin>

In my computer, the location of MSBuild.exe is in C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\MSBuild.exe, not C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\15.0\Bin\MSBuild.exe.

@cclauss
Copy link
Contributor

cclauss commented May 5, 2020

gyp ERR! node-gyp -v v3.8.0

v3.8.0 is too old vs. https://github.com/nodejs/node-gyp/releases.
Please upgrade with npm install -g npm@latest or as suggested above.

@liudonghua123
Copy link

@cclauss Thanks, I will try to upgrade node-gyp and test.

@sparsh-99
Copy link

Anyone please resolve my errors:

gyp ERR! UNCAUGHT EXCEPTION
gyp ERR! stack Error: spawn C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\MSBuild.exe ENOENT
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:267:19)
gyp ERR! stack at onErrorNT (internal/child_process.js:469:16)
gyp ERR! stack at processTicksAndRejections (internal/process/task_queues.js:84:21)
gyp ERR! System Windows_NT 10.0.18362
gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Users\spars\AppData\Roaming\nvm\v12.16.3\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\spars\JPMC-tech-task-2-PY3\node_modules\bufferutil
gyp ERR! node -v v12.16.3
gyp ERR! node-gyp -v v5.1.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://github.com/nodejs/node-gyp/issues
npm WARN [email protected] requires a peer of [email protected] - 3 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of popper.js@^1.14.6 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of webpack@^3.1.0 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 7
npm ERR! [email protected] install: prebuild-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.

@cclauss
Copy link
Contributor

cclauss commented May 28, 2020

https://www.npmjs.com/package/fsevents only runs on macOS so please do not try to install it on Windows.

@cclauss cclauss added ERR! node-gyp -v < v10.x.x npm install -g npm Node Sass --> Dart Sass https://github.com/sass/node-sass/issues/2952 labels Jul 3, 2020
@knopkem
Copy link

knopkem commented Jan 28, 2021

I know it is closed but maybe still helpful for people that come here (like me) via a google search.
For me it helped to start the command (e.g. npm install) from the correct development console:
'x64 native tools command prompt for VS 2017'

@ahmedababnehalef
Copy link

ahmedababnehalef commented Apr 26, 2021

If you are using "node-sass", upgrade it to version 5.0.0, make sure that you have build tools 2017 and Python 3 installed, and issue these commands prior to npm install
npm config set msvs_version 2017
npm config set python /path/to/executable/python39/python.exe

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ERR! node-gyp -v < v10.x.x npm install -g npm Node Sass --> Dart Sass https://github.com/sass/node-sass/issues/2952
Projects
None yet
Development

No branches or pull requests