使用命令npm install后,我无法下载puppeter

I can't download the puppeter, after using command npm install

提问人:RavaAja 提问时间:8/12/2023 最后编辑:engRavaAja 更新时间:8/13/2023 访问量:151

问:

我正在尝试安装 puppeteer,每次我遇到相同的错误时,我已经安装了 Chromium 和 puppeteer-core,我的节点版本是 v20.4.0,我的 npm 版本是 9.8.1,有人有解决方案吗?

PS:我已经尝试删除node_modules和package-lock.json

npm ERR! code 1
npm ERR! path C:\SC by IchanZX V3\node_modules\puppeteer
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c node install.js
npm ERR! node:internal/modules/cjs/loader:415
npm ERR!       const err = new Error(
npm ERR!                   ^
npm ERR!
npm ERR! Error: Cannot find module 'C:\SC by IchanZX V3\node_modules\progress\index.js'. Please verify that the package.json has a valid "main" entry
npm ERR!     at tryPackage (node:internal/modules/cjs/loader:415:19)
npm ERR!     at Module._findPath (node:internal/modules/cjs/loader:665:18)
npm ERR!     at Module._resolveFilename (node:internal/modules/cjs/loader:1034:27)
npm ERR!     at Module._load (node:internal/modules/cjs/loader:901:27)
npm ERR!     at Module.require (node:internal/modules/cjs/loader:1115:19)
npm ERR!     at require (node:internal/modules/helpers:119:18)
npm ERR!     at Object.<anonymous> (C:\SC by IchanZX V3\node_modules\puppeteer\lib\cjs\puppeteer\node\install.js:24:36)
npm ERR!     at Module._compile (node:internal/modules/cjs/loader:1233:14)
npm ERR!     at Module._extensions..js (node:internal/modules/cjs/loader:1287:10)
npm ERR!     at Module.load (node:internal/modules/cjs/loader:1091:32) {
npm ERR!   code: 'MODULE_NOT_FOUND',
npm ERR!   path: 'C:\\SC by IchanZX V3\\node_modules\\progress\\package.json',
npm ERR!   requestPath: 'progress'
npm ERR! }
npm ERR!
npm ERR! Node.js v20.4.0

npm ERR! A complete log of this run can be found in: C:\Users\Ravabox\AppData\Local\npm-cache\_logs\2023-08-12T10_31_57_338Z-debug-0.log```
JavaScript 依赖项 语法错误 已弃用

评论


答:

0赞 Deotyma 8/13/2023 #1

也许尝试安装 Node 的 LTS 版本。它更稳定,错误更少,软件维护时间更长 时间。目前是 18.17.1(包括 npm 9.6.7)。你可以在这里找到这个版本。