I installed node.js v14.15.4 and node-gyp version 7.1.2 on my windows 10.
When I run npm install
I got those errors;
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin\MSBuild.exe` failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Users\xxx\\AppData\\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\build.js:194:23)
gyp ERR! stack at ChildProcess.emit (events.js:315:20)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)
gyp ERR! System Windows_NT 10.0.17134
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\xxx\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\xxx\myProject\node_modules\mmmagic
gyp ERR! node -v v14.15.4
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
.
.
.
npm verb stack Error: mmmagic@0.4.5 install: `node-gyp rebuild`
npm verb stack Exit status 1
npm verb stack at EventEmitter.<anonymous> (C:\Users\xxx\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\index.js:332:16)
npm verb stack at EventEmitter.emit (events.js:315:20)
npm verb stack at ChildProcess.<anonymous> (C:\Users\xxx\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
npm verb stack at ChildProcess.emit (events.js:315:20)
npm verb stack at maybeClose (internal/child_process.js:1048:16)
npm verb stack at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
npm verb pkgid mmmagic@0.4.5
npm verb cwd C:\Users\x199377\AppData\Local\Programs\Git\Ego\ego\ego-app
npm verb Windows_NT 10.0.17134
npm verb argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\xxx\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "i" "--verbose"
npm verb node v14.15.4
npm verb npm v6.14.8
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! mmmagic@0.4.5 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the mmmagic@0.4.5 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm verb exit [ 1, true ]
npm timing npm Completed in 83077ms
I followed the steps described on the node-gyp but does not work. PS: I have python 2.7 installed and I installed python 3.8.
Npm is installed with a node-gyp integrated and it contains an old version, I upgraded the node-gyp:
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"
For more details you can take a look at Upgrading node-gyp independently of npm and handling multiple versions.