简体   繁体   English

JScript编译错误Node.js命令行工具

[英]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. 因此,我正在尝试使用node.js构建命令行工具,但在尝试运行该工具时遇到了问题。 Here's the simple code that I have. 这是我的简单代码。

src/main.js SRC / main.js

#!/usr/bin/env node
'use strict';

(function main() {
    console.log('Hello World!');
})();

and in my packages.json I have this added 在我的packages.json添加了这个

"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. 但是,当我尝试从命令行执行test ,在第1行char 1无效字符代码800A03F6处收到Microsoft JScript编译错误。

Any ideas what I might be missing? 有什么想法可能会丢失吗? Thanks :) 谢谢 :)

Found the information from this tutorial 从本教程中找到了信息

npm install -g npm安装-g

test 测试

Hello, world! 你好,世界!

Did you try to install it before running it? 您是否在运行之前尝试安装它?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 JScript文件中的编译错误 - Compilation Error in JScript File 没有 NodeJS 的 Typescript 命令行编译 - Typescript command line compilation without NodeJS 获取 Microsoft JScript 编译错误 - Getting Microsoft JScript compilation error “ Microsoft JScript编译错误:预期为';'”调用ASMX Web服务 - “Microsoft JScript compilation error: Expected ';'” Invoking ASMX Web Service Jscript 语法错误 - 代码 800A03EA - Microsoft JScript 编译 - Sawtooth 供应链 - Windows 10 - Jscript syntax error - code 800A03EA - Microsoft JScript compilation - Sawtooth Supply Chain - Windows 10 Gulp在Windows上运行失败 错误消息:Microsoft JScript编译错误,无效字符 - Gulp run fails on windows | Error Message : Microsoft JScript compilation error, Invalid character 命令行标准输出到Node.js中的数组 - Command line stdout to array in nodejs NodeJS Express命令行交互 - NodeJS Express Command Line Interaction 有没有办法在Windows Scripting Host(WSH)cscript.exe中从JScript(而不是javascript)运行命令行命令? - Is there a way to run a command line command from JScript (not javascript) in Windows Scripting Host (WSH) cscript.exe? JScript中的NodeJS + JQuery php变量 - NodeJS + JQuery php variable in JScript
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM