node.js SyntaxError:无效或意外的令牌 [英] node.js SyntaxError: Invalid or unexpected token

查看:47
本文介绍了node.js SyntaxError:无效或意外的令牌的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经从 https://nodejs.org/en/下载并安装了node.js.我想运行一个js文件:

I have downloaded and installed node.js from https://nodejs.org/en/. I want to run a js file:

console.log('hello');

我运行 node app.js

I run node app.js

并出现语法错误:

SyntaxError: Invalid or unexpected token
[90m    at Module._compile (internal/modules/cjs/loader.js:895:18)[39m
[90m    at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10)[39m
[90m    at Module.load (internal/modules/cjs/loader.js:815:32)[39m
[90m    at Function.Module._load (internal/modules/cjs/loader.js:727:14)[39m
[90m    at Function.Module.runMain (internal/modules/cjs/loader.js:1047:10)[39m
[90m    at internal/main/run_main_module.js:17:11[39m

我的操作系统信息:

Version: 10.0.18362
BuildNumber: 18362
OSArchitecture: 32-bit

node.js v12.13.1

node.js v12.13.1

推荐答案

您是否从单词或其他内容中复制了一些Unicode字符?

Did you copy some unicode characters from word or something?

尝试重新键入 console.log('hello')的样式,以前,当我从Word文档中复制一些代码时,这种事情发生在我身上.

try retyping the console.log('hello') Something like this has happened to me before, when I copied some code from a word document.

这篇关于node.js SyntaxError:无效或意外的令牌的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆