我可以在本地命令行中使用firebase deploy部署我的friebase应用程序(https://github.com/Luuuuuis/profile-page),但当我推送它时,它总是失败,-> No code error。
这是我的GitHub操作:https://github.com/Luuuuuis/profile-page/blob/master/.github/workflows/main.yml,它在尝试构建时失败。https://github.com/Luuuuuis/profile-page/runs/792416930?check_suite_focus=true
这是我得到的错误:
Error: EACCES: permission denied, open '/usr/local/lib/node_modules/firebase-tools/node_modules/storage-engine/lib/compatibility/index.js' at Object.openSync (fs.js:443:3) at Object.writeFileSync (fs.js:1194:35) at /usr/local/lib/node_modules/firebase-tools/node_modules/storage-engine/lib/compatibility/detect.js:35:15 at Object. (/usr/local/lib/node_modules/firebase-tools/node_modules/storage-engine/lib/compatibility/detect.js:45:3) at Module._compile (internal/modules/cjs/loader.js:778:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10) at Module.load (internal/modules/cjs/loader.js:653:32) at tryModuleLoad (internal/modules/cjs/loader.js:593:12) at Function.Module._load (internal/modules/cjs/loader.js:585:3) at Module.require (internal/modules/cjs/loader.js:692:17) npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.1.2 (node_modules/firebase-tools/node_modules/chokidar/node_modules/fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"}) npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! storage-engine@3.0.7 postinstall: node ./compatibility/detect.js npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the storage-engine@3.0.7 postinstall 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! /root/.npm/_logs/2020-06-21T10_52_59_937Z-debug.log The command '/bin/sh -c npm install -g firebase-tools' returned a non-zero code: 1 ##[error]Docker build failed with exit code 1
它昨天已经起作用了,但当我今天多次尝试它时,它不起作用。我的行为有什么问题吗?
发布于 2020-06-22 01:12:26
尝试使用--unsafe-perm标志或配置一个环境变量: NPM_CONFIG_USER根
发布于 2020-06-21 19:32:35
EACCES: permission denied您应该尝试使用sudo执行它
发布于 2020-06-21 22:32:37
这更多的是为了其他人来看这个问题,可能是为了相关的问题,但不是确切的问题。对于特定的原始问题,这些问题似乎是一个基础问题。但是,如果像我一样,您遇到了类似的权限问题(正如phyyyl的回答中所指出的),这就是我修复它的方法。
为了绕过权限,我使用了the npm docs中的解释。因此,安装时不要使用-g标志,并使用npx,它可以识别出安装的程序不是全局安装的。我使用netlify,所以不确定等效的firebase是什么。但我希望这能有所帮助。
deploy:
image: node:latest
stage: deploy
before_script:
- npm install netlify-cli
script:
- npx netlify deploy --dir publichttps://stackoverflow.com/questions/62497883
复制相似问题