Node PKG - Error: ENOENT: no such file or directory /snapshot

Viewed 304

I am gonna use PKG to create a single executable. The building process passes successful but in case of calling my executable it will fail with the message: Error: ENOENT: no such file or directory, chmod '/snapshot/webp-converter/node_modules/webp-converter/bin/libwebp_osx/bin/cwebp'

cwebp is a dependency which i installed with npm install webp-converterand it runs flawless on the machine in my ide. First I started to declare this dependency or all node_modules as assets in my package.json. I used inside my application path.join and process.cwd() the read files. The binary of the webp-converter package is not available after packing it together.

There comes the "pkg" part of the package.json file: "pkg": { "outputPath": "dist", "assets": [ "/node_modules/**/*"]}

Has anyone any idea to get it fixed? In my opinion the file is not packed to the executable. I took the direct path of the file cwebp and all node_modules, but no path worked out to get it running

Kind regards

0 Answers
Related