Closed abcdedf closed 8 years ago
What does the script look like?
Same error here. The contents of the file are irrelevant. The issue is probably that on Ubuntu, the program is called "nodejs" rather than "node". In atom-runner, the solution was to put the following into config.cson:
runner:
extensions:
...
scopes:
...
js: "nodejs"
...
This tells atom-runner to run js files using "nodejs".
But, this does not work with script-runner.
Use a shebang line at the start of your script. script-runner is made to obey shebang lines.
#!/usr/bin/env node
is what you want to put at the start of the file.
Also I think this post from StackOverflow is relevant. It explains how the node
executable is named differently on Ubuntu and what can and should be done to mitigate the issue. Essentially you should set up a symlink at /usr/bin/node
to the nodejs
executable. This will make your scripts cross platform.
Alternatively you can always use the shebang line:
#!/usr/bin/env nodejs
I just installed script runner and wrote a simple Hello World js testing it out. When I run it, I get the above error. What could be wrong in my set up? Node installed and working.