Adonis packaging


#1

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

or

https://www.npmjs.com/package/nexe

or


#2

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


#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


#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.


#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)