I recently created a new EBS environment using Node.js 14 as my old environment is deprecated. Unfortunately, I'm running into the error below:
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
It seems TS is unable to generate my JS files due to permissions.
I didn't have this problem in my old environment. Also I've already added the unsafe-perm=true
to .npmrc.
Any thoughts are greatly appreciated,
Thanks!