节点 ace build --生产,[错误]“构建” Digital Ocean Apps 上出现命令未找到错误
尝试使用以下部署命令配置应用程序时:
构建命令 npm 运行构建
运行命令 node build/server.js
抛出以下错误:
[email protected] 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 [email protected]` 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)
如果将构建命令更改为: 构建命令 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
没有构建命令。
感谢您的帮助。
When trying to configure an application with the following deploy commands:
Build Commandnpm run build
Run Commandnode build/server.js
The following error is thrown:
[email protected] 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 [email protected]` 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 Commandnode 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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不知道您在 adonis 上运行的确切版本,但是您正在寻找的构建命令位于 @adonisjs/assembler 包中,默认情况下该包作为开发依赖项安装,我猜当您部署时,您设置了 NODE_ENV 环境当软件包安装在服务器上时,默认情况下将变量设置为生产环境。仅安装正常的依赖项,因此要么将 @adonisjs/assembler 添加到正常的依赖项,要么您可以将 NODE_ENV 设为开发,但我不推荐
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