Node script executable

  node.js, question

The node script to implement a certain function has been written. How to convert this script into an executable file. This makes it possible to run exe files without node environment to realize script function.

How can you run java without java environment and how can you run node without node environment
How can one survive without one’s living environment?

1. The system provides a corresponding environment, and then you can run your node directly.
2. Package an environment, for example, package the node environment with your node script, such as the current electron or nwjs
3. Use your target environment (such as linux shell), write a shell script, install your node environment after running, and then run your script.