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

Error in GitHub action Error: spawn /opt/hostedtoolcache/node/16.17.0/x64/bin/npx ENOENT #182

Open
iqfareez opened this issue Sep 13, 2022 · 3 comments
Assignees

Comments

@iqfareez
Copy link

iqfareez commented Sep 13, 2022

Error: There was an error when attempting to execute the process '/opt/hostedtoolcache/node/16.17.0/x64/bin/npx'. This may indicate the process failed to start. Error: spawn /opt/hostedtoolcache/node/16.17.0/x64/bin/npx ENOENT

The action then fails

Code:

name: deploy website
on: [push]
jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: actions/setup-node@v3
        with:
          node-version: 16
      - run: yarn install
      - run: yarn build
      - uses: amondnet/vercel-action@v20 #deploy
        with:
          vercel-token: ${{ secrets.VERCEL_TOKEN }} # Required
          github-token: ${{ secrets.GITHUB_TOKEN }} #Optional
          vercel-args: '--prod' #Optional
          vercel-org-id: ${{ secrets.ORG_ID}}  #Required
          vercel-project-id: ${{ secrets.PROJECT_ID}} #Required
          working-directory: ./build
@iqfareez iqfareez changed the title Error in GitHub action Error in GitHub action Error: spawn /opt/hostedtoolcache/node/16.17.0/x64/bin/npx ENOENT Sep 13, 2022
@nkuehn
Copy link

nkuehn commented Oct 21, 2022

I can confirm the problem in a similar action setup. It works in a different job in the same workflow and I have yet to find out the key difference.

@amondnet amondnet self-assigned this Oct 22, 2022
@dlip
Copy link

dlip commented Nov 3, 2022

In my case, the working-directory didn't exist. I agree the error is confusing actions/toolkit#573

@dawidrogowicz
Copy link

was also caused by wrong working-directory for me

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

5 participants