尝试运行 Payload CMS 项目时出现尖锐包错误

问题描述 投票:0回答:1

我正在尝试遵循一个基于 Payload CMS 模板构建电子商务项目的教程 我正在基于电子商务项目创建有效负载项目,然后将其克隆到我的 github,然后将其克隆到我的本地计算机,并尝试使用以下命令安装依赖项:

npm install --legacy-peer-deps

PS C:\Users\FPCC\Desktop\WEB DEV\e-commerce-cms> npm install --legacy-peer-deps
npm WARN deprecated [email protected]: this will be v4
npm WARN cleanup Failed to remove some directories [
npm WARN cleanup   [
npm WARN cleanup     'C:\\Users\\FPCC\\Desktop\\WEB DEV\\e-commerce-cms\\node_modules',
npm WARN cleanup     [Error: EPERM: operation not permitted, rmdir 'C:\Users\FPCC\Desktop\WEB DEV\e-commerce-cms\node_modules\@aws-crypto'] {     
npm WARN cleanup       errno: -4048,
npm WARN cleanup       code: 'EPERM',
npm WARN cleanup       syscall: 'rmdir',
npm WARN cleanup       path: 'C:\\Users\\FPCC\\Desktop\\WEB DEV\\e-commerce-cms\\node_modules\\@aws-crypto'
npm WARN cleanup     }
npm WARN cleanup   ]
npm WARN cleanup ]
npm ERR! code 1
npm ERR! path C:\Users\FPCC\Desktop\WEB DEV\e-commerce-cms\node_modules\sharp
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c (node install/libvips && node install/dll-copy && prebuild-install) || (node install/can-compile && node-gyp rebuild && node install/dll-copy)
npm ERR! sharp: Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.14.5/libvips-8.14.5-win32-x64.tar.br
npm ERR! sharp: Please see https://sharp.pixelplumbing.com/install for required dependencies
npm ERR! sharp: Installation error: Request timed out

npm ERR! A complete log of this run can be found in: C:\Users\FPCC\AppData\Local\npm-cache\_logs\2023-12-08T17_17_02_626Z-debug-0.log

我尝试过的:

  • 在独立项目上安装sharp软件包并且安装成功,没有任何问题
  • 使用使用 NVM 的其他版本的节点(16、18、21、最新)
  • 从项目的package.json文件中删除sharp包,然后在安装package.json包后尝试安装它
  • 与上面的步骤相同,但使用
    npm install --platform=win32 --arch=x64 sharp
  • 使用yarn安装deps
javascript node.js npm next.js yarnpkg
1个回答
0
投票

我也遇到同样的问题,请问你解决了吗? 我的错误信息是:

PS E:\sites\digitalhippo2> npm install --save --legacy-peer-deps payload      
npm ERR! code 1
npm ERR! path E:\sites\digitalhippo2\node_modules\payload\node_modules\sharp
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c (node install/libvips && node install/dll-copy && prebuild-install) || (node install/can-compile && node-gyp rebuild && node install/dll-copy)
npm ERR! sharp: Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.14.5/libvips-8.14.5-win32-x64.tar.br
npm ERR! sharp: Please see https://sharp.pixelplumbing.com/install for required dependencies   
npm ERR! sharp: Installation error: connect ETIMEDOUT 20.205.243.166:443

npm ERR! A complete log of this run can be found in: C:\Users\admin\AppData\Local\npm-cache\_logs\2024-01-25T13_44_16_028Z-debug-0.log
© www.soinside.com 2019 - 2024. All rights reserved.