rycirese
rycirese

Reputation: 199

JScript compilation error nodejs command line tool

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

Answers (1)

Isaac
Isaac

Reputation: 12874

Found the information from this tutorial

npm install -g

test

Hello, world!

Did you try to install it before running it?

Upvotes: 4

Related Questions