nexe not working with node version 15.8.0

587 Views Asked by At

Nexe documentation says that it works with Node version 15.8.0 on Windows. So I used nvm to install and switch to node version 15.8.0 but when I run

nexe app.js on my windows machine it shows:

enter image description here

I do not want to use to --build flag to build from scratch as it seems to take a lot of time to build. The nexe documentation in Github says that:

The above works and has been tested with node.js 14.5.4 and 15.8.0

nvm does not support 14.5.4 version yet so I have not tried with that version but I am not sure why it is saying 15.8.0 is not supported when the documentation says it does.

2

There are 2 best solutions below

0
On

I had the same situation and still used the --build. It takes some time only once (as in the future it has already downloaded all it needs) and after that builds it lightning fast every time so I strongly recommend trying the "uncomfortable" way next time as well.

0
On

For those who use alpine, you can build new image of any version nodejs, create a dummy hello world file and try with --build for rebuilt nexe with nodejs. Here's a sample Dockerfile of nodejs version 16:

FROM node:16-alpine

RUN apk add g++ gcc linux-headers make python3 && \
npm install -g nexe && \
# Create a dummy hello world file
echo "console.log('Hello world!');" > hello.js && \
# Node 14+ needs Python 3
nexe hello.js --build --make=-j4 --python=$(which python3) --verbose

For those who use AMI - Amazon Machine Image, you can create a script in provisioners section with following content for pre building it.

npm i nexe -g
$hello = "console.log('Hello world!');"
$hello | Out-File hello.js
nexe "hello.js" --build --verbose