以太坊开发-搭建本地remix开发环境

2021/6/13 10:26:06

本文主要是介绍以太坊开发-搭建本地remix开发环境,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

1.下载安装nodejs

 

 2.命令行安装remix-ide

npm install remix-ide -g

3.启动remix-ide

remix-ide

4.解决报错

解决方案: 编辑\AppData\Roaming\npm\node_modules\remix-ide\bin\remix-ide,去删除remixd相关内容

去除之前,如下:
#!/usr/bin/env node
var path = require(‘path’)
var httpServer = require(‘http-server’)
var remixd = require(‘remixd’)
var server = httpServer.createServer({
root: path.join(__dirname, ‘/…/’)
})
var folder = process.argv.length > 2 ? process.argv[2] : process.cwd()
server.listen(8080, ‘127.0.0.1’, function () {})
var router = new remixd.Router(65520, remixd.services.sharedFolder, { remixIdeUrl: ‘http://localhost:8080’ }, (webSocket) => {
remixd.services.sharedFolder.setWebSocket(webSocket)
remixd.services.sharedFolder.setupNotifications(folder)
remixd.services.sharedFolder.sharedFolder(folder, false)
})
router.start()
console.log(’\x1b[33m%s\x1b[0m’, 'Starting Remix IDE at http://localhost:8080 and sharing ’ + folder)
 
去除之后如下:
#!/usr/bin/env node
var path = require(‘path’)
var httpServer = require(‘http-server’)
var server = httpServer.createServer({
root: path.join(__dirname, ‘/…/’)
})
var folder = process.argv.length > 2 ? process.argv[2] : process.cwd()
server.listen(8080, ‘127.0.0.1’, function () {})
console.log(’\x1b[33m%s\x1b[0m’, 'Starting Remix IDE at http://localhost:8080 and sharing ’ + folder)
 

启动成功后,输入 localhost:8080不行的话,可以考虑加个路径/index ,即:localhost:8080/index,就可以啦

 



这篇关于以太坊开发-搭建本地remix开发环境的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!


扫一扫关注最新编程教程