PKG Failed to make Bytecode

I am getting this warning when I try and run .. pkg index.js -t macOS

node v17.3.1 [email protected]

Warning Failed to make bytecode node17-arm64 for file /snapshot/______/index.js

was hoping anyone could help,

I have also tried to use -b and got

Error: ENOENT: no such file or directory, open '/var/folders/fy/c5tgsjcj63q73kfvg_dd53fh0000gn/T/pkg.d5ef9dd92b18360a4ff95824/node/out/Release/node

thank you

1

2 Answers

I used @vercel/ncc to generate one index.js file and then use pkg on the generated index.js file.

My package.json scripts is like this:

"scripts": { "test": "jest", "start": "node src/index.js", "dev": "nodemon src/index.js", "build": "ncc build -o build/lib ./src/index.js && pkg --target node16-win-x64 -o build/MY-API.exe ./build/lib/index.js" }, 
2

My Script was written in ES6, I ran it threw Babel and then tried again and it worked perfectly!!

2

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

You Might Also Like