gpt4 book ai didi

node.js - 当我尝试安装 Node 包时出现 zlib 错误

转载 作者:太空宇宙 更新时间:2023-11-03 23:14:27 24 4
gpt4 key购买 nike

在使用此命令进行 npm 更新后,我在使用 npm 安装新软件包时遇到问题:npm install -g npm@latest 为了解决与在 Node 模块中安装 sqlite3 相关的问题 Electron 应用程序。

但是当我尝试运行 sqlite3 的命令:npm install sqlite3 --save 或任何其他命令来安装新包时,它会出现此错误:

npm WARN tar zlib: Cannot read property 'length' of null
npm WARN tar zlib: Cannot read property 'length' of null
npm WARN tar zlib: Cannot read property 'length' of null
npm WARN tar zlib: Cannot read property 'length' of null
npm WARN tar zlib: Cannot read property 'length' of null
npm WARN tar zlib: Cannot read property 'length' of null
npm WARN tar zlib: Cannot read property 'length' of null
npm WARN tar zlib: Cannot read property 'length' of null
npm WARN tar zlib: Cannot read property 'length' of null
npm WARN tar zlib: Cannot read property 'length' of null
npm WARN tar zlib: Cannot read property 'length' of null
npm WARN tar zlib: Cannot read property 'length' of null
npm WARN tar zlib: Cannot read property 'length' of null
npm WARN tar zlib: Cannot read property 'length' of null
npm WARN tar zlib: Cannot read property 'length' of null
npm WARN tar zlib: Cannot read property 'length' of null
npm WARN tar zlib: Cannot read property 'length' of null
npm WARN tar zlib: Cannot read property 'length' of null
npm WARN tar zlib: Cannot read property 'length' of null
npm WARN tar zlib: Cannot read property 'length' of null
npm WARN tar zlib: Cannot read property 'length' of null
npm WARN tar zlib: Cannot read property 'length' of null
npm WARN tar zlib: Cannot read property 'length' of null
npm WARN tar zlib: Cannot read property 'length' of null
npm WARN tar zlib: Cannot read property 'length' of null
npm WARN tar zlib: Cannot read property 'length' of null
npm WARN tar zlib: Cannot read property 'length' of null
npm WARN tar zlib: Cannot read property 'length' of null
npm WARN tar zlib: Cannot read property 'length' of null
npm WARN tar zlib: Cannot read property 'length' of null
npm WARN tar zlib: Cannot read property 'length' of null
npm WARN tar ENOENT: no such file or directory, chmod 'C:\Users\Ahmed\Desktop\Desktop_stuffs\workspace\terrains\Gestion Ecole\electron-quick-start\node_modules\.staging\sqlite3-2e42d809'
npm WARN tar ENOENT: no such file or directory, open 'C:\Users\Ahmed\Desktop\Desktop_stuffs\workspace\terrains\Gestion Ecole\electron-quick-start\node_modules\.staging\sax-8976b37c\lib\sax.js'
npm WARN tar zlib: Cannot read property 'length' of null
npm WARN tar zlib: Cannot read property 'length' of null
npm WARN bootstrap@4.3.1 requires a peer of popper.js@^1.14.7 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.0.7 (node_modules\fsevents):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: zlib: Cannot read property 'length' of null
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules\rijs.resdir\node_modules\fsevents):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: zlib: Cannot read property 'length' of null

npm ERR! zlib: Cannot read property 'length' of null

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Ahmed\AppData\Roaming\npm-cache\_logs\2019-07-31T22_03_39_222Z-debug.log

运行npm版本给出:

{'electron-quick-start': '1.0.0', 
npm: '6.10.2',
ares: '1.13.0',
cldr: '32.0',
http_parser: '2.7.0',
icu: '60.1',
modules: '59',
nghttp2: '1.25.0',
node: '9.2.0',
openssl: '1.0.2m',
tz: '2017c',
unicode: '10.0',
uv: '1.16.1',
v8: '6.2.414.44-node.11',
zlib: '1.2.11' }

最佳答案

我修复了这个问题,这只是 NPM 和 Node 之间的兼容性问题,我将最新版本的 NPM 与旧版本的 Node 一起使用,所以我只是下载了最新版本的 Node 来更新它,以及安装命令运行正常。

关于node.js - 当我尝试安装 Node 包时出现 zlib 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57299425/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com