node-gyp: Error: `gyp` failed with exit code: 1
Node Version: Node 12.22.12 and NPM 6.14.16 Node-Gyp Version: >= v9.1.0 Platform: Windows10 Module: node-gyp configure
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (C:\Program Files\nodejs\node_global\node_modules\node-gyp\lib\configure.js:284:16)
gyp ERR! stack at ChildProcess.emit (events.js:314:20)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:276:12)
gyp ERR! System Windows_NT 10.0.19044
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_global\\node_modules\\node-gyp\\bin\\node-gyp.js" "configure"
gyp ERR! cwd C:\Users\tlx\Desktop\electron-quick-start-master\dll
gyp ERR! node -v v12.22.12
gyp ERR! node-gyp -v v9.1.0
gyp ERR! not ok
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 15 (7 by maintainers)
I removed
<%app_data%>/Local/node-gyp/Cache,<%user%>/.electron-gyp,node_modules,package-lock.jsonthen reinstalled all packages and it works now.A possible easier solution could be to run:
npx node-gyp install, which reinstalls node-gyp’s copy of the C development headers for the running version of NodeJS.(If you need to reinstall headers for a different version of NodeJS or Electron, more arguments may be needed. Such as
npx node-gyp install 16.0.0to [re]install headers for NodeJS 16.0.0… Ornpx node-gyp install --dist-url=https://electronjs.org/headers 18.0.0to install headers for Electron 18.0.0, I think.)If this doesn’t work, then @michalzaq12’s comment above seems like a more thorough solution.