We have a NestJS based backend using the App Platform.
Deployments were working fine until today, where we got the following error during build:
[2024-01-10 14:23:15] │ Running custom build command: yarn build
[2024-01-10 14:23:15] │ yarn run v1.22.21
[2024-01-10 14:23:15] │ $ rimraf dist
[2024-01-10 14:23:17] │ $ nest build
[2024-01-10 14:23:17] │ /bin/sh: 1: nest: not found
[2024-01-10 14:23:17] │ error Command failed with exit code 127.
[2024-01-10 14:23:17] │ info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
[2024-01-10 14:23:17] │ building: exit status 127
[2024-01-10 14:23:17] │ ERROR: failed to build: exit status 1
What have been changed / what should we change? (Force deployment with clean caches have not worked)
It’s really puzzling since we have a quite identical “test” environment where everything works fine, even after this error occurred, with forced rebuild & clean caches as well.
I have read somewhere that the “@nestjs/cli” would not work as “devDependency” but as a regular “dependency” (and this sound as a plausible reason), but why have not occurred then this error way before?
Any hint / help is really appreciated :) Gabor
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Sign up for Infrastructure as a Newsletter.
Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
For anyone interested: it really sees that somehow DO build/deployment started working differently out of the blue.
As far as we concluded, earlier our app was able to use/access the devDependencies and since this was no more the case, we had to make some dependency/configuration/command changes and were able to make it work.
An useful article how to access devDependencies during the build : https://docs.digitalocean.com/products/app-platform/reference/buildpacks/nodejs/#specifying-devdependencies
Thanks for sharing your solution, @gaborrendes! In my case I found the cause of error suddenly appearing was adding the
NODE_ENV
environmental variable with valueproduction
. Without this, the development dependencies are installed just fine and thenest build
command runs.