16

I see the following error when executing npm install -g serverless via buildspec.yml from AWS Codebuild

storage-engine@3.0.7 postinstall /usr/local/lib/node_modules/serverless/node_modules/storage-engine node ./compatibility/detect.js

Error: EACCES: permission denied, open '/usr/local/lib/node_modules/serverless/node_modules/storage-engine/lib/compatibility/index.js'

2 Answers2

1

Used yarn instead of npm.

yarn global add serverless
eibay
  • 11
  • 2
0

Use the command

sudo chmod -R 777 {your node module link that is shown in the error}

In this case the link shown in the error is /usr/local/lib/node_modules/serverless/node_modules/storage-engine/lib/compatibility/index.js so your command would be:

sudo chmod -R 777 /usr/local/lib/node_modules/serverless/node_modules/storage-engine/lib/compatibility/index.js