github-action
github-action copied to clipboard
EACCES: permission denied
My code:
name: Deploy master branch
on:
push:
branches:
- master
jobs:
deploy:
name: deploy
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- name: Deploy to eu-west-3
uses: serverless/[email protected]
with:
args: deploy --stage products-new --region eu-west-3
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
- name: Deploy to us-west-2
uses: serverless/[email protected]
with:
args: deploy --stage products-new --region us-west-2
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
- name: Deploy to us-east-1
uses: serverless/[email protected]
with:
args: deploy --stage products-new --region us-east-1
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
prebuild-install WARN install EACCES: permission denied, access '/root/.npm'
gyp WARN EACCES current user ("nobody") does not have permission to access the dev dir "/root/.cache/node-gyp/14.18.2"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/lib/node_modules/serverless/node_modules/snappy/.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 '/usr/lib/node_modules/serverless/node_modules/snappy/.node-gyp'
gyp ERR! System Linux 5.11.0-1022-azure
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/lib/node_modules/serverless/node_modules/snappy
gyp ERR! node -v v14.18.2
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
I tried with version 2.17.1 and with master, and its the same error.
Any update on this?
I created my own Github Action because this one is not maintained
name: Deploy master
on:
push:
branches:
- master
jobs:
deploy-master:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: "10.x"
- name: Install Serverless Framework
run: npm install -g serverless
- name: Serverless AWS authentication
run: sls config credentials --provider aws --key ${{ secrets.AWS_ACCESS_KEY_ID }} --secret ${{ secrets.AWS_SECRET_ACCESS_KEY }}
- name: Install NPM dependencies
run: npm install
- name: Deploy
run: sls deploy