简体   繁体   English

安装 puppeteer 导致“文件已存在”错误

[英]Installing puppeteer results in “file already exists” error

When I first tried to install puppeteer through npm, I got errors saying permission is denied for the .local-chromium folder.当我第一次尝试通过 npm 安装 puppeteer 时,我收到错误消息说.local-chromium文件夹的权限被拒绝。 So I followed this SO post and that error went away, but now there is another (base path is omitted):所以我跟着这个 SO 帖子,那个错误消失了,但现在有另一个(基本路径被省略):

$ sudo npm install puppeteer --unsafe-perm=true

> puppeteer@5.2.1 install ##########/node_modules/puppeteer
> node install.js

(node:25349) ExperimentalWarning: The fs.promises API is experimental
Downloading Chromium r782078 - 126.4 Mb [====================] 100% 0.0s 
ERROR: Failed to set up Chromium r782078! Set "PUPPETEER_SKIP_DOWNLOAD" env variable to skip download.
{ [Error: EEXIST: file already exists, mkdir '##########/node_modules/puppeteer/.local-chromium/linux-782078']
  errno: -17,
  code: 'EEXIST',
  syscall: 'mkdir',
  path:
   '##########/node_modules/puppeteer/.local-chromium/linux-782078' }
npm WARN notsup Unsupported engine for puppeteer@5.2.1: wanted: {"node":">=10.18.1"} (current: {"node":"10.4.0","npm":"6.14.7"})
npm WARN notsup Not compatible with your version of node/npm: puppeteer@5.2.1
npm WARN notsup Unsupported engine for extract-zip@2.0.1: wanted: {"node":">= 10.17.0"} (current: {"node":"10.4.0","npm":"6.14.7"})
npm WARN notsup Not compatible with your version of node/npm: extract-zip@2.0.1

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! puppeteer@5.2.1 install: `node install.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the puppeteer@5.2.1 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!     ######/.npm/_logs/2020-07-30T16_32_37_096Z-debug.log

But that directory doesn't exist, nor does puppeteer at all within node_modules so I can't delete it and retry.但是该目录不存在, puppeteer中的node_modules也不存在,所以我无法删除它并重试。 I'm not sure what the installation is reffering to.我不确定安装指的是什么。 Does anybody have any idea what it could mean?有人知道这意味着什么吗?

Also, this is irrelevant but another concern is with the warnings saying that a node version >=10.18.1 is wanted and so 10.4.0 is unsupported, any ideas what's up with that as well?另外,这无关紧要,但另一个问题是警告说需要节点版本>=10.18.1 ,因此不支持10.4.0 ,还有什么想法吗?

I ended up using nvm to switch to the stable Node release (10.18.1) which resolved both the errors and the warnings.我最终使用nvm切换到稳定的 Node 版本(10.18.1),它解决了错误和警告。 I guess there was some incompatibility with newer Node versions.我猜想与较新的 Node 版本有些不兼容。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 错误:EEXIST:文件已存在,在 vps 上安装 puppeteer 时,mkdir '/node_modules/puppeteer/.local-chromium/linux-756035' - Error: EEXIST: file already exists, mkdir '/node_modules/puppeteer/.local-chromium/linux-756035' when install puppeteer on vps Gulp错误=文件已存在, - Gulp error = file already exists, EEXIST:文件已经存在,用于在 Dockerfile 中全局安装 npm package - EEXIST: file already exists for installing npm package globally in Dockerfile 如何知道木偶实例是否已经存在? - How to know if a puppeteer instance already exists? Firebase Web Init 错误文件已存在 - Firebase Web Init Error File Already Exists 未定义的 Puppeteer 启动器错误结果 - Puppeteer launcher error results with undefined 如果文件已经存在,如何在fs.rename命令上触发错误? - How to trigger error on fs.rename command if file already exists? macOS Big Sur:使用 EFBIG 安装 puppeteer 时出错:文件太大,写入 - macOS Big Sur: error installing puppeteer with EFBIG: file too large, write 检查目标文件是否已经存在 - Checking if destination file already exists 每个命令的 npm 错误:EEXIST:文件已经存在,mkdir 'c:\\users\\user\\appdata\\Roaming\\npm' - npm error on every command: EEXIST: file already exists, mkdir 'c:\users\user\appdata\Roaming\npm'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM