尝试使用npm安装时出现node-pre-gyp错误

4

我正在尝试安装sqlite时,出现以下错误:

  • npm版本为v6.4.1
  • node版本为v8.11.4
  • 操作系统为Windows 10

我已经尝试清除缓存、重新安装nodejs/npm以及执行其他一些在其他问题中找到的随机操作(如设置msvs版本、设置python配置变量等)。

错误日志:

kawthar@Romana MINGW64 ~/Desktop/Nodev/Artesã (JS)
$ npm install sqlite --save    

> sqlite3@4.0.2 install C:\Users\kawthar\Desktop\Nodev\Artesã (JS)\node_modules\sqlite3
> node-pre-gyp install --fallback-to-build

'node-pre-gyp' is not recognized as an internal or external command,
operable program or batch file.

npm WARN qi-bot@1.0.0 No description
npm WARN qi-bot@1.0.0 No repository field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! sqlite3@4.0.2 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the sqlite3@4.0.2 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\kawthar\AppData\Roaming\npm-cache\_logs\2018-08-30T22_28_34_617Z-debug.log

我必须在Windows上全局安装它:npm install -g node-pre-gyp - mikebridge
1个回答

2
请使用以下命令并重试:

npm install -g node-gyp

现在我遇到了一个问题 gyp ERR! stack Error: 证书链中存在自签名证书 有什么建议吗? - Bob Small
现在我遇到了一个问题 gyp ERR! stack Error: 证书链中存在自签名证书 有什么建议吗? - undefined

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接