我想从模块 BodyPix 导入代码,但我不断收到以下错误消息:
import * as bodyPix from '@tensorflow-models/body-pix';
^
SyntaxError: Unexpected token *
at Module._compile (internal/modules/cjs/loader.js:718:23)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:785:10)
at Module.load (internal/modules/cjs/loader.js:641:32)
at Function.Module._load (internal/modules/cjs/loader.js:556:12)
at Function.Module.runMain (internal/modules/cjs/loader.js:837:10)
at internal/main/run_main_module.js:17:11
我尝试了不同的导入方式,但似乎没有任何效果。
最佳答案
CommonJS - 样式导入应该有效:
const bodyPix = require('@tensorflow-models/body-pix');
关于javascript - 语法错误 : Unexpected token *,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56581250/