0

So, one of my github actions workflow is giving me an error: "Command "next" not found."

i really don't know why next isn't being found, i've done an ls earlier and it's running the script in the right folder, next.js is listed as a dependency as seen here

i also had a test workflow running, and that worked perfectly

here are the full logs

enter image description here

this error is very odd, since i just copy and pasted this workflow from another project i have, and there everything works fine

the working deploy workflow: web_deploy.yml

the broken deploy workflow: web_deploy_broken.yml


Answer

i was missing a version entry in my package.json, yes, that's it

1 Answer 1

2

You are missing install dependencies step like here

- name: Install dependencies
  run: yarn install

It's not github action problem - you are just missing a dependency. next doesn't come with plain yarn

Sign up to request clarification or add additional context in comments.

5 Comments

so you're suggesting i remove cache from setup-node?
i just removed caching from setup-node, yarn install ran as normal, my other services compile as normal, but the web one just breaks, it cant find next.js for some reason, i also removed 'yarn' from the script, i literally have no idea of why this is not working
OH MY GOD, the problem was that i didnt have a version thing on my package.json, now the workflow is giving a build error
Well update it or create a new one :) and provide full information about your package.json and full workflow - otherwise it's a guessing game...
i've solved it already thanks, the problem was that my package.json didn't have the version entry, the other error was some react stuff thank you

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.