Unexpected token *

简介:

Env:node v10.5.0


Error:

4ae3e6379c227b946c366ba9875f6fd0f92d5f5f

Code:


import * as tf from '@tensorflow/tfjs';

Solution:


const tf = require('@tensorflow/tfjs');

Reason:

该版本node只支持部分es6的语法,对于import这种就不支持,需要改为es5的语法


Other:

这也解决了刚入行时遇到的一个问题:当时我问同事为什么有的地方使用require("")而有的地方引用不了?原来是语法的原因。问这个问题的根本原因还是对es5和es6的语法不了解

相关文章
|
10月前
|
存储 安全 前端开发
message“: “CSRF token mismatch
message“: “CSRF token mismatch
251 0
|
10月前
eslint: error Parsing error: Unexpected token <
eslint: error Parsing error: Unexpected token <
202 0
|
10月前
|
JavaScript
fast admin报错:Unexpected token ‘<‘, “ (已解决)
fast admin报错:Unexpected token ‘<‘, “ (已解决)
146 0
错误一例:expected expression before } token
错误一例:expected expression before } token
191 0
|
JSON 数据格式
解决报错信息之:SyntaxError: Unexpected token R in JSON at position 0
解决报错信息之:SyntaxError: Unexpected token R in JSON at position 0
317 0
【C】解决error: expected ‘;’ before ‘)’ token
【C】解决error: expected ‘;’ before ‘)’ token
|
JavaScript
Uncaught SyntaxError: Unexpected token <
Uncaught SyntaxError: Unexpected token <
558 0
Uncaught SyntaxError: Unexpected token <
Uncaught SyntaxError: Unexpected token ILLEGAL
Created by Jerry Wang, last modified on Aug 24, 2014 该错误大多数情况和引号相关: http://blog.csdn.net/itmyhome1990/article/details/18084937
196 0
Uncaught SyntaxError: Unexpected token ILLEGAL
|
Linux Shell Windows
Linix登录报"/etc/profile: line 11: syntax error near unexpected token `$'{\r''"
同事反馈他在一测试服务器(CentOS Linux release 7.2.1511)上修改了/etc/profile文件后,使用source命令不能生效,让我帮忙看看,结果使用SecureCRT一登录就发现下面错误信息: Last login: Fri Nov 4 00:42:45 2016 from 10.
1979 0

热门文章

最新文章