Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
295 views
in Technique[技术] by (71.8m points)

javascript - 将node_modules导入在浏览器上运行的私有以太坊区块链应用中(Importing node_modules into private ethereum blockchain app that is on run on a browser)

I'm trying to develop my ethereum dapp and run in on a web browser.

(我正在尝试开发以太坊dapp并在网络浏览器中运行。)

I downloaded "web3-eth-accounts" module via terminal.

(我通过终端下载了“ web3-eth-accounts”模块。)

In my javascript file, I import it like this.

(在我的javascript文件中,我是这样导入的。)

var Accounts = require('web3-eth-accounts');

When I run my program via terminal typing "npm run dev"

(当我通过终端输入“ npm run dev”运行程序时)

In my console I get

(在我的控制台中,我得到)

Uncaught Error: Cannot find module 'web3-eth-accounts'

I tried different methods, but I'm still stuck.

(我尝试了不同的方法,但仍然遇到问题。)

Any solutions?

(有什么办法吗?)

Thank you for your time!

(感谢您的时间!)

  ask by CerolDaDeveloper translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...