Reputation: 199
So I'm trying to build a command line tool using node.js
but am running into problems trying to run the tool. Here's the simple code that I have.
src/main.js
#!/usr/bin/env node
'use strict';
(function main() {
console.log('Hello World!');
})();
and in my packages.json
I have this added
"bin": {
"test": "./src/main.js"
}
But when I try and execute test
from the command line I get a Microsoft JScript compilation error at line 1 char 1 invalid character code 800A03F6.
Any ideas what I might be missing? Thanks :)
Upvotes: 3
Views: 9273