节点 ace build --生产,[错误]“构建” Digital Ocean Apps 上出现命令未找到错误

发布于 2025-01-09 05:31:07 字数 2024 浏览 1 评论 0原文

尝试使用以下部署命令配置应用程序时:

构建命令 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 Command
npm run build
Run Command
node 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 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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

狼性发作 2025-01-16 05:31:07

我不知道您在 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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文