0

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
  • 1
    JScript is not modern JavaScript, so don’t expect to be able to use NodeJS in the Windows Scripting Host.
    – user692942
    Commented Mar 25, 2023 at 8:52

1 Answer 1

-1

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 🤖
2
  • Thanks for your honesty at least, but using chatGPT is not allowed on StackOverflow. Commented Mar 31, 2023 at 5:30
  • I was not aware of that. I just posted it so that it might help someone.
    – Suvel Mano
    Commented Mar 31, 2023 at 8:35

Not the answer you're looking for? Browse other questions tagged or ask your own question.