【发布时间】:2022-01-01 05:17:02
【问题描述】:
我已经构建了这个节点服务器,我正在尝试使用 bcrypt 作为依赖项将其部署到 AWS Elastic Beanstalk(通过管道),但它似乎效果不佳。这是日志,对于任何感兴趣的人,我可以提供完整的最后 100 行。
2021/11/22 15:36:13.652664 [ERROR] An error occurred during execution of command [app-deploy] - [Use NPM to install dependencies]. Stop running the command. Error: Command /bin/sh -c npm --production install failed with error exit status 1. Stderr:node-pre-gyp WARN Pre-built binaries not installable for bcrypt@5.0.1 and node@14.17.1 (node-v83 ABI, glibc) (falling back to source compile with node-gyp)
node-pre-gyp WARN Hit error EACCES: permission denied, mkdir '/var/app/staging/node_modules/bcrypt/lib'
gyp WARN EACCES current user ("healthd") does not have permission to access the dev dir "/root/.cache/node-gyp/14.17.1"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/var/app/staging/node_modules/bcrypt/.node-gyp"
gyp WARN install got an error, rolling back install
gyp WARN install got an error, rolling back install
gyp ERR! configure error
gyp ERR! stack Error: EACCES: permission denied, mkdir '/var/app/staging/node_modules/bcrypt/.node-gyp'
gyp ERR! System Linux 4.14.252-195.483.amzn2.x86_64
gyp ERR! command "/opt/elasticbeanstalk/node-install/node-v14.17.1-linux-x64/bin/node" "/opt/elasticbeanstalk/node-install/node-v14.17.1-linux-x64/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/var/app/staging/node_modules/bcrypt/lib/binding/napi-v3/bcrypt_lib.node" "--module_name=bcrypt_lib" "--module_path=/var/app/staging/node_modules/bcrypt/lib/binding/napi-v3" "--napi_version=8" "--node_abi_napi=napi" "--napi_build_version=3" "--node_napi_label=napi-v3"
gyp ERR! cwd /var/app/staging/node_modules/bcrypt
gyp ERR! node -v v14.17.1
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute '/opt/elasticbeanstalk/node-install/node-v14.17.1-linux-x64/bin/node /opt/elasticbeanstalk/node-install/node-v14.17.1-linux-x64/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/var/app/staging/node_modules/bcrypt/lib/binding/napi-v3/bcrypt_lib.node --module_name=bcrypt_lib --module_path=/var/app/staging/node_modules/bcrypt/lib/binding/napi-v3 --napi_version=8 --node_abi_napi=napi --napi_build_version=3 --node_napi_label=napi-v3' (1)
这些应该是证明它是 bcrypt 错误的关键行,但我不明白如何解决它。顺便说一句,它在本地工作,只会使 aws 崩溃。
【问题讨论】:
标签: amazon-web-services amazon-elastic-beanstalk