When trying to configure an application with the following deploy commands:
Build Command npm run build
Run Command node build/server.js
The following error is thrown:
clinica-medica-backend@1.0.0 build
node ace build --production
[ error ] "build" command not found
npm notice
npm notice New minor version of npm available! 8.4.1 -> 8.5.1
npm notice Changelog: <https://github.com/npm/cli/releases/tag/v8.5.1>
npm notice Run `npm install -g npm@8.5.1` to update!
npm notice
building: exit status 1
ERROR: failed to build: exit status 1
For documentation on the buildpacks used to build your app, please see:
Node.js: https://do.co/apps-buildpack-node
! Build failed (145)
If you change the build command to: Build Command node ace
The following is shown:
Running custom build command: node ace
Available commands
repl Start a new REPL session
db
db:seed Execute database seeder files
dump
dump:rcfile Dump contents of .adonisrc.json file along with defaults
generate
generate:key Generate a new APP_KEY secret
generate:manifest Generate ace commands manifest file. Manifest file speeds up commands lookup
list
list:routes List application routes
make
make:migration Make a new migration file
make:model Make a new Lucid model
make:seeder Make a new Seeder file
migration
migration:rollback Rollback migrations to a given batch number
migration:run Run pending migrations
migration:status Check migrations current status.
Global Flags
-h, --help boolean
-v, --version boolean
Without the build command.
Thanks for help.
I don't know what exact version you are running on with adonis however the build command you are looking for is in the @adonisjs/assembler package which is installed as a dev dependency by default and I guess when you deploy you set the NODE_ENV environment variable to production by default which when the packages get installed on the server. only the normal dependencies get installed so either add the @adonisjs/assembler to the normal dependencies or you can make the NODE_ENV to be development which I do not recommend
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.