【发布时间】:2021-10-03 19:28:33
【问题描述】:
我最近使用 Node.js 14 创建了一个新的 EBS 环境,因为我的旧环境已被弃用。不幸的是,我遇到了以下错误:
Jul 27 22:34:53 ip-172-31-42-207 web: error TS5033: Could not write file '/var/app/current/build/server/validation.js.map': EACCES: permission denied, open '/var/app/current/build/server/validation.js.map'.
Jul 27 22:34:53 ip-172-31-42-207 web: error TS5033: Could not write file '/var/app/current/build/triggers/Triggers.js': EACCES: permission denied, open '/var/app/current/build/triggers/Triggers.js'.
Jul 27 22:34:53 ip-172-31-42-207 web: error TS5033: Could not write file '/var/app/current/build/triggers/Triggers.js.map': EACCES: permission denied, open '/var/app/current/build/triggers/Triggers.js.map'.
Jul 27 22:34:53 ip-172-31-42-207 web: npm ERR! code ELIFECYCLE
Jul 27 22:34:53 ip-172-31-42-207 web: npm ERR! errno 2
Jul 27 22:34:53 ip-172-31-42-207 web: npm ERR! ballotbox-server@0.0.1 start: `tsc && node build/index.js`
Jul 27 22:34:53 ip-172-31-42-207 web: npm ERR! Exit status 2
Jul 27 22:34:53 ip-172-31-42-207 web: npm ERR!
Jul 27 22:34:53 ip-172-31-42-207 web: npm ERR! Failed at the ballotbox-server@0.0.1 start script.
Jul 27 22:34:53 ip-172-31-42-207 web: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
Jul 27 22:34:53 ip-172-31-42-207 web: npm ERR! A complete log of this run can be found in:
Jul 27 22:34:53 ip-172-31-42-207 web: npm ERR! /home/webapp/.npm/_logs/2021-07-27T22_34_53_315Z-debug.log
Jul 27 22:34:53 ip-172-31-42-207 web: > ballotbox-server@0.0.1 start /var/app/current
Jul 27 22:34:53 ip-172-31-42-207 web: > tsc && node build/index.js
似乎TS由于权限无法生成我的JS文件。
我在旧环境中没有这个问题。此外,我已经将 unsafe-perm=true 添加到 .npmrc。
非常感谢任何想法,
谢谢!
【问题讨论】:
标签: node.js typescript amazon-web-services npm amazon-elastic-beanstalk