Windows Script Host prompts this error when trying to run your node cli

enter image description here

Steps to reproduce issue:

  1. Create simple node 'Hello world' project
  2. use npm link to link the package.
  3. Try running the module using <packagename>.
1

There are 1 best solutions below

2
Suvel Mano On

I was able to run the module using this link at the to of my index.js(main) file #!/usr/bin/env node.

In the case of Node.js, this line is used to specify that the script should be run with the Node.js interpreter. When you run a script with this shebang, the shell looks for the node executable in the system's $PATH environment variable and uses it to execute the script.

  • answered ChatGPT