Adonis packaging

#1

I there is a way to package the adonis application into a exe or .sh, using

or

or

0 Likes

#2

the project is discontinued and moved to new pkg.js. I tried that too, not working with adonis folder structure

0 Likes

#3

When you say it’s not working, what errors do you get? Does that project says that it needs a certain project structure?

Try to debug things and post questions for specific issues. Saying it doesn’t work is not going to help you or others

0 Likes

#4

when running pkg server.js, i can get the output.

but when i run ./server-macos i get the below error.

Error: Cannot find module ‘/snapshot/adonis/package.json’

at /snapshot/adonis/server.js(anonymous):null

1 Ignitor._setPackageFile
/snapshot/adonis/node_modules/@adonisjs/ignitor/src/Ignitor/index.js:148

2 Ignitor.fire
/snapshot/adonis/node_modules/@adonisjs/ignitor/src/Ignitor/index.js:719

3 Ignitor.fireHttpServer
/snapshot/adonis/node_modules/@adonisjs/ignitor/src/Ignitor/index.js:791

so i guessed. “pkg” expects someother folder structure.

0 Likes

#5

I tried another available packaging project “nexe”.

In that i get a different error.

internal/modules/cjs/loader.js:583
throw err;
^

Error: Cannot find module ‘youch’
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15)
at Function.Module._load (internal/modules/cjs/loader.js:507:25)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:20:18)
at f (/Volumes/DATA/LOG_FUZE_WS_DATA/gitProjects/branch_sujai/energy-projects_nexe/venilla/core/adonis/server:20782:1092)
at u (/Volumes/DATA/LOG_FUZE_WS_DATA/gitProjects/branch_sujai/energy-projects_nexe/venilla/core/adonis/server:20782:1430)
at c (/Volumes/DATA/LOG_FUZE_WS_DATA/gitProjects/branch_sujai/energy-projects_nexe/venilla/core/adonis/server:20782:2750)
at b.require (/Volumes/DATA/LOG_FUZE_WS_DATA/gitProjects/branch_sujai/energy-projects_nexe/venilla/core/adonis/server:20782:3346)
at Object. (/Volumes/DATA/LOG_FUZE_WS_DATA/gitProjects/branch_sujai/energy-projects_nexe/venilla/core/adonis/server:1696:15)
at c (/Volumes/DATA/LOG_FUZE_WS_DATA/gitProjects/branch_sujai/energy-projects_nexe/venilla/core/adonis/server:20782:3584)

0 Likes

#6

any followup for this? i am facing the same issue
i build a pkg using zeit pkg.
during the build, it log out:
Warning Cannot find module ‘@adonisjs/bodyparser’ from ‘/Users/soonzhi/Desktop/Projects/postmortem’
/Users/soonzhi/Desktop/Projects/postmortem/server.js

Warning Cannot find module ‘@adonisjs/cors’ from ‘/Users/soonzhi/Desktop/Projects/postmortem’
/Users/soonzhi/Desktop/Projects/postmortem/server.js
Warning Cannot find module ‘@adonisjs/drive’ from ‘/Users/soonzhi/Desktop/Projects/postmortem’
/Users/soonzhi/Desktop/Projects/postmortem/server.js
Warning Cannot find module ‘@adonisjs/mail’ from ‘/Users/soonzhi/Desktop/Projects/postmortem’
/Users/soonzhi/Desktop/Projects/postmortem/server.js
Warning Cannot find module ‘@adonisjs/shield’ from ‘/Users/soonzhi/Desktop/Projects/postmortem’
/Users/soonzhi/Desktop/Projects/postmortem/server.js
Warning Cannot find module ‘@adonisjs/validator’ from ‘/Users/soonzhi/Desktop/Projects/postmortem’

then, when i try to run the executable, it show:
RuntimeException: E_MISSING_CONFIG: logger.transport is not defined inside config/app.js file

More details: https://err.sh/adonisjs/errors/E_MISSING_CONFIG



1 Function.missingConfig
  /snapshot/postmortem/node_modules/@adonisjs/generic-exceptions/src/RuntimeException.js:38

2 LoggerFacade.transport
  /snapshot/postmortem/node_modules/@adonisjs/framework/src/Logger/Facade.js:90

3 Object.get
  /snapshot/postmortem/node_modules/@adonisjs/framework/src/Logger/Facade.js:41

4 new Server
  /snapshot/postmortem/node_modules/@adonisjs/framework/src/Server/index.js:41

5 Object.app.singleton [as closure]
  /snapshot/postmortem/node_modules/@adonisjs/framework/providers/AppProvider.js:149

6 Ioc._resolveBinding
  /snapshot/postmortem/node_modules/@adonisjs/fold/src/Ioc/index.js:231

7 Ioc.use
  /snapshot/postmortem/node_modules/@adonisjs/fold/src/Ioc/index.js:731

8 ValidationProvider.boot
  /snapshot/postmortem/node_modules/@adonisjs/validator/providers/ValidatorProvider.js:87

9 _bootProviders._.filter.map
  /snapshot/postmortem/node_modules/@adonisjs/fold/src/Registrar/index.js:147

10 arrayMap
  /snapshot/postmortem/node_modules/lodash/lodash.js:639

11 Function.map
  /snapshot/postmortem/node_modules/lodash/lodash.js:9556

12 interceptor
  /snapshot/postmortem/node_modules/lodash/lodash.js:16993

13 thru
  /snapshot/postmortem/node_modules/lodash/lodash.js:8797

14 anonymous
  /snapshot/postmortem/node_modules/lodash/lodash.js:4374

15 arrayReduce
  /snapshot/postmortem/node_modules/lodash/lodash.js:683

16 baseWrapperValue
0 Likes

#7

Happy to accept a PR, if someone wants to work on it

0 Likes

#8

Same here, when running via pm2.

0 Likes