balderdashy / sails

Realtime MVC Framework for Node.js
https://sailsjs.com
MIT License
22.84k stars 1.95k forks source link

Using pkg with sailsjs to create executable file #6920

Open Islamaim opened 4 years ago

Islamaim commented 4 years ago

Please i need a tutorial or example how to use pkg library with sailsjs (v0.12) to create a standalone exe file. I tried using pkg with a simple backend server of a single file and it works successfully. But i couldn't make it for a sails project. Many thanks for all suggestions

sailsbot commented 4 years ago

@Islamaim Thanks for posting! We'll take a look as soon as possible.

In the mean time, there are a few ways you can help speed things along:

Please remember: never post in a public forum if you believe you've found a genuine security vulnerability. Instead, disclose it responsibly.

For help with questions about Sails, click here.

johnabrams7 commented 4 years ago

@Islamaim What happens when you attempt to make this for a v0.12 sails project?

Islamaim commented 4 years ago

@Islamaim What happens when you attempt to make this for a v0.12 sails project?

In Sails project package.json file I added the next lines: "bin":"app.js", "pkg": { "scripts": "node_modules/**/*", "assets": "assets/**/*" } The error that I have is that after running "pkg ." command, the project cann't be run asking for gruntfile and tasks. I think the problem is that I don´t know how to include project folders and files. Be çcause it works fine for a single file server with express So, tell me if you have some instructions to follow to make this process. I still a beginner in that part. Many thanks

johnabrams7 commented 4 years ago

@Islamaim We honestly don't know of any existing tutorials for pkg and sails (at the moment) to specifically create a standalone Windows executable .exe from your project - but we'll leave this open for community feedback / recommendations / experiences. I see you asked about this on the pkg github issues as well - definitely recommended to spread the exposure. 👍