我在盖茨比的网站上工作。目前我已经在本地很好地构建了它,但是当我尝试部署到Gatsby Cloud时,在“安装项目依赖项”过程中失败了,原始日志显示如下:
17:39:24 PM:
Cloning into '/usr/src/app/www'...
17:39:29 PM:
npm ERR! bindings not accessible from webpack-dev-server:fsevents
17:39:29 PM:
npm
17:39:29 PM:
ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2021-08-19T23_39_29_074Z-debug.log
17:39:29 PM:
NPM ci --unsafe-perm --prefer-offline --no-audit failure - Command failed with exit code 1 (EPERM): npm ci --unsafe-perm --prefer-offline --no-audit --registry=https://registry.npmjs.org/
17:39:29 PM:
NPM ci --unsafe-perm --prefer-offline --no-audit attempt 1 of 3...
17:39:31 PM:
npm
17:39:31 PM:
ERR! bindings not accessible from webpack-dev-server:fsevents
17:39:31 PM:
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2021-08-19T23_39_31_076Z-debug.log
17:39:31 PM:
NPM ci --unsafe-perm --prefer-offline --no-audit --registry=https://registry.npmjs.org/ failure - Command failed with exit code 1 (EPERM): npm ci --unsafe-perm --prefer-offline --no-audit --registry=https://registry.npmjs.org/
17:39:31 PM:
NPM ci --unsafe-perm --prefer-offline --no-audit --registry=https://registry.npmjs.org/ attempt 2 of 3...
17:39:33 PM:
npm
17:39:33 PM:
ERR! bindings not accessible from webpack-dev-server:fsevents
17:39:33 PM:
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2021-08-19T23_39_33_080Z-debug.log
17:39:33 PM:
NPM ci --unsafe-perm --prefer-offline --no-audit --registry=https://registry.npmjs.org/ failure - Command failed with exit code 1 (EPERM): npm ci --unsafe-perm --prefer-offline --no-audit --registry=https://registry.npmjs.org/
17:39:33 PM:
NPM ci --unsafe-perm --prefer-offline --no-audit --registry=https://registry.npmjs.org/ attempt 3 of 3...
17:39:35 PM:
npm
17:39:35 PM:
ERR! bindings not accessible from webpack-dev-server:fsevents
17:39:35 PM:
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2021-08-19T23_39_35_038Z-debug.log
17:39:35 PM:
NPM ci --unsafe-perm --prefer-offline --no-audit --registry=https://registry.npmjs.org/ failure - Command failed with exit code 1 (EPERM): npm ci --unsafe-perm --prefer-offline --no-audit --registry=https://registry.npmjs.org/
17:39:35 PM:
ERROR Failed to compile: Error: Command failed with exit code 1 (EPERM): npm ci --unsafe-perm --prefer-offline --no-audit --registry=https://registry.npmjs.org/我使用的是Linux (Ubuntu)操作系统。节点版本14.16.0。
尽管这个错误似乎并不表明构建失败是因为fsevent不存在(而是fsevent无法访问“绑定”--老实说,这是一个我很迷惑的术语),但我确实尝试过在本地安装fsevent,它失败了(这并不奇怪,因为它似乎是用于MacOS的)。但我也尝试手动将它放在我的package.json的依赖项和devDependencies中(我的想法是云服务器会安装它)。这也不起作用。
在这个问题上我很迷惑,任何帮助都将不胜感激。我也不确定我到哪里去获取上面原始日志中引用的完整日志。如果我找到这些,我会更新,如果我还没有上传它们,任何帮助去哪里获得这些都将不胜感激。
谢谢
发布于 2021-08-23 15:23:56
Gatsby Cloud support建议删除package-lock.json文件。这就解决了我的问题!
您需要确保还将package-lock.json包含在.gitignore文件中,以防止下次在您自己的计算机上构建时将其上载到GitHub。
https://stackoverflow.com/questions/68855639
复制相似问题