【发布时间】:2019-12-26 14:17:33
【问题描述】:
我克隆了这个 Angular 项目:https://github.com/etherparty/explorer
我想在其中安装另一个模块:https://github.com/miguelmota/ethereum-input-data-decoder
我现在想在 Angular 中使用 npm 包的功能。它不起作用。
我采取的步骤:
npm install ethereum-input-data-decoder
试过了,是否有效。不!
然后我在 transactionInfosController.js 文件的第 1 行添加了导入,因为我想在那里使用新模块。
import { InputDataDecoder } from '../../ethereum-input-data-decoder';
程序部分崩溃并出现错误:
Uncaught SyntaxError: Unexpected token {
我意识到我错误地导入了节点包。
但是查看克隆的 git repo 的文件结构,我没有看到可以导入包的另一个文件。
我需要在哪里放置导入/我需要创建哪个文件?
编辑:需要 AngularJS 的答案
【问题讨论】:
-
你在 NodeJS 中使用
ethereum-input-data-decoder包??? -
我是通过 npm install ethereum-input-data-decoder 安装的
-
试图让它在角度工作
标签: node.js angularjs npm module package