npm ERR! command C:\Windows\system32\cmd.exe /d /s /c node-gyp-build

1,024 阅读1分钟

修复 npm install ffi-napi失败

这是我提交的GitHub issues github.com/node-ffi-na…

PS C:\Users\Administrator\Documents\electron.app> npm i -f
...
npm ERR! code 1
npm ERR! path C:\Users\Administrator\Documents\electron.app\node_modules@breush\ffi-napi
npm ERR! command failed
npm ERR! command C:\windows\system32\cmd.exe /d /s /c C:\Users\ADMINI~1\AppData\Local\Temp\install-feaec2d3.cmd
npm ERR! 'C:\Program' �����ڲ����ⲿ���Ҳ���ǿ����еij���
npm ERR! �����������

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Administrator\AppData\Local\npm-cache_logs\2024-05-20T12_14_21_065Z-debug-0.log

The following method worked for me because the issue was caused by version 4.8.1:

npm install node-gyp-build@4.8.0 -D

Make sure to set "node-gyp-build" to "4.8.0" in your package.json:

  "devDependencies": {
    "node-gyp-build": "4.8.0"
  }