I am probably doing something stupid here. I have a web service which is a Next app and I keep running into this
“next: command not found”
I can see Next in my package.json and I have “npm install; npm run build” in my “Build Command” section. The “Start Command” is “next start” and that’s where it fails.
There could be a couple of reasons for this issue that I know of:
You have set NODE_ENV to production and you only have next as a dependency in your devDependecies . npm doesn’t install devDependcies when NODE_ENV is production.
You are using a monorepo and have set the root directory setting to a subdirectory of your Git repo. Unfortunately when you do this, <monorepo-root>/node_modules/.bin doesn’t get added to the PATH so the commands installed here can’t be found. You will need to run next with the correct path, which is ./node_modules/.bin/next
If neither of the above issues apply, please let us know.