Pkg: How do i package node_modules

Created on 20 Feb 2018  路  2Comments  路  Source: vercel/pkg

Hi! if the packaged app starts and closes if I don't add the node_modules directory in the same directory as the project.

All 2 comments

What kind of dependencies do you include within your node_modules directory ?
pkg states in the README it does not currently include native modules within the bundle:

Native addons (.node files) use is supported, but packaging .node files inside the executable is not resolved yet. You have to deploy native addons used by your project to the same directory as the executable.

Another common error is not to non static requires in your node.js code:

// this won't work
const config = require(__dirname + '/config.js')

I hope this helps,

Yup! I got it working. I missed the part about the native modules. Apologies for the late update.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

hellower picture hellower  路  3Comments

Araknos picture Araknos  路  4Comments

gillez picture gillez  路  4Comments

jflayhart picture jflayhart  路  4Comments

Admiral-Enigma picture Admiral-Enigma  路  3Comments