I tried to find a duplicate question, there are similar ones but I still don't understand what's going on..
I just installed node and npm on Ubuntu 20.04 with
sudo apt install nodejs npm
And followed the Electron quick start tutorial, and added this line to the beginning of my main.js:
console.log("node version: " + process.versions["node"]);
When I run my app with npm start
, I see (both on the console and on the app) node version 16.13.0, but when I run the app with node main
, I see the version as 10.19.0, which is also what node -v
shows.
I can probably "fix" this issue by updating node, but I would like to understand what is going on here.. Is NPM using a different node version or something?
Thanks
Edit
I tried this with an empty node app, just made npm init
and set start: "node index.js"
in package.json
, this time both node index.js
and npm start
show the same version (10.19.0) so I'm guessing Electron is somehow reading a wrong node version?