Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

why is it giving me a 'npx' command not found... #13

Closed
gotexis opened this issue Oct 13, 2020 · 9 comments
Closed

why is it giving me a 'npx' command not found... #13

gotexis opened this issue Oct 13, 2020 · 9 comments

Comments

@gotexis
Copy link

gotexis commented Oct 13, 2020

/usr/local/bin/npx [email protected] ./** --bucket *** --region *** --cwd . --distId *** --etag --gzip xml,html,htm,js,css,ttf,otf,svg,txt --invalidate / --noCache --deleteRemoved true
Error: There was an error when attempting to execute the process '/usr/local/bin/npx'. This may indicate the process failed to start. Error: spawn /usr/local/bin/npx ENOENT
@Reggionick
Copy link
Owner

Reggionick commented Oct 19, 2020

On which container are you running the job? Seems that NodeJS is missing or there is a wrong (old) version.

@samehhady
Copy link

samehhady commented Nov 18, 2020

facing the same issue, running on ubuntu-latest

name: Deploy
on:
  push:
    branches: [ main ]
  pull_request:
    branches: [ main ]
defaults:
  run:
    working-directory: frontend
jobs:
  run:
    runs-on: ubuntu-latest
    env:
      AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
      AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
    steps:
        - uses: actions/checkout@v2

        - name: Install dependencies
          run: yarn

        - name: Build
          run: yarn build

        - name: Deploy
          uses: reggionick/s3-deploy@v3
          with:
            folder: build
            bucket: ${{ secrets.S3_BUCKET }}
            bucket-region: ${{ secrets.S3_BUCKET_REGION }}
            dist-id: ${{ secrets.CLOUDFRONT_DISTRIBUTION_ID }}
            invalidation: /
            delete-removed: true
            no-cache: true
            private: true

@samehhady
Copy link

/usr/local/bin/npx [email protected] ./** --bucket *** --region *** --cwd ./ --distId *** --etag --gzip xml,html,htm,js,css,ttf,otf,svg,txt --invalidate / --deleteRemoved --noCache --private
Error: There was an error when attempting to execute the process '/usr/local/bin/npx'. This may indicate the process failed to start. Error: spawn /usr/local/bin/npx ENOENT

@samehhady
Copy link

Found the issue, it is related to the "working-directory" when i set a default directory it fail, had to specify it in each step instead

@Reggionick
Copy link
Owner

Thanks @samehhady for the analysis. I close the issue since is not related to this action.

@CharlieDigital
Copy link

@samehhady Can you share some more details? I'm facing the same issue:

Run reggionick/[email protected]
  with:
    folder: build
    bucket: ***
    bucket-region: ***
    delete-removed: true
    no-cache: true
    private: true
  env:
    AWS_ACCESS_KEY_ID: ***
    AWS_SECRET_ACCESS_KEY: ***
/opt/hostedtoolcache/node/12.20.0/x64/bin/npx [email protected] ./** --bucket *** --region *** --cwd ./ --etag --gzip xml,html,htm,js,css,ttf,otf,svg,txt --deleteRemoved --noCache --private
Error: There was an error when attempting to execute the process '/opt/hostedtoolcache/node/12.20.0/x64/bin/npx'. This may indicate the process failed to start. Error: spawn /opt/hostedtoolcache/node/12.20.0/x64/bin/npx ENOENT

@loginov-rocks
Copy link

Hi!

I guess it makes sense to respect the default parameters in the action :)

@kees- kees- mentioned this issue Apr 5, 2022
@vinicius5581
Copy link

vinicius5581 commented Aug 7, 2022

@samehhady Can you share some more details? I'm facing the same issue:

Run reggionick/[email protected]
  with:
    folder: build
    bucket: ***
    bucket-region: ***
    delete-removed: true
    no-cache: true
    private: true
  env:
    AWS_ACCESS_KEY_ID: ***
    AWS_SECRET_ACCESS_KEY: ***
/opt/hostedtoolcache/node/12.20.0/x64/bin/npx [email protected] ./** --bucket *** --region *** --cwd ./ --etag --gzip xml,html,htm,js,css,ttf,otf,svg,txt --deleteRemoved --noCache --private
Error: There was an error when attempting to execute the process '/opt/hostedtoolcache/node/12.20.0/x64/bin/npx'. This may indicate the process failed to start. Error: spawn /opt/hostedtoolcache/node/12.20.0/x64/bin/npx ENOENT

@CharlieDigital Did you ever figured this out? I'm getting the same error.

Run reggionick/s3-deploy@v3
  with:
    folder: frontend/build
    bucket: ***
    bucket-region: ***
    dist-id: ***
    invalidation: /
    delete-removed: true
    no-cache: true
    private: true
  env:
    AWS_REGION: ***
    AWS_ACCESS_KEY_ID: ***
    AWS_SECRET_ACCESS_KEY: ***
  
/opt/hostedtoolcache/node/16.16.0/x64/bin/npx s[3](https://github.com/PROJECTPATHr/runs/7711017599?check_suite_focus=true#step:5:3)-deploy@1.[4](https://github.com/PROJECTPATH/runs/7711017599?check_suite_focus=true#step:5:4).0 ./** --bucket *** --region *** --cwd ./ --distId *** --etag --gzip xml,html,htm,js,css,ttf,otf,svg,txt --invalidate / --deleteRemoved --noCache --private
Error: There was an error when attempting to execute the process '/opt/hostedtoolcache/node/1[6](https://github.com/PROJECTPATH/runs/7711017599?check_suite_focus=true#step:5:6).[16](https://github.com/PROJECTPATH/runs/7711017599?check_suite_focus=true#step:5:17).0/x64/bin/npx'. This may indicate the process failed to start. Error: spawn /opt/hostedtoolcache/node/16.16.0/x64/bin/npx ENOENT

@teerzo
Copy link

teerzo commented May 1, 2023

I'm getting the same error, im defining v3.2.0 but its reverting back to 1.40 because of a bug in the current npm version included for github actions

it reverts back to the last published npm version (1.4.0 https://www.npmjs.com/package/s3-deploy)

Issue in npm has since been fixed, but github actions by default still uses the broken version 8.15.0
npm/cli#5132 (comment)

Solution is to set the npm version yourself
actions/runner-images#6136 (comment)
https://github.com/actions/setup-node

Hope this helps

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants