简体   繁体   English

进行演示无法正常工作

[英]embark demo not working

blockchain@blockchain-VirtualBox:~/embark$ embark demo
Initializing Embark Template....
Installing packages.. this can take a few seconds
Init complete

App ready at ./embark_demo
-------------------
next steps:
-> cd ./embark_demo
-> embark blockchain or embark simulator
open another console in the same directory and run
-> embark run
For more info go to http://github.com/iurimatias/embark-framework
blockchain@blockchain-VirtualBox:~/embark$ cd embark_demo/
blockchain@blockchain-VirtualBox:~/embark/embark_demo$ embark blockchain
===============================================================================
===============================================================================
Embark Blockchain Using: Go-Ethereum (https://github.com/ethereum/go-ethereum)
===============================================================================
===============================================================================
running: geth --networkid 12301 --datadir=".embark/development/datadir" --password config/development/password account list
WARN [04-18|17:44:26] No etherbase set and no accounts found as default
already initialized
/usr/local/lib/node_modules/embark/node_modules/solc/soljson.js:1
(function (exports, require, module, __filename, __dirname) { var Module;if(!Module)Module=(typeof Module!=="undefined"?Module:null)||{};var moduleOverrides={};for(var key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var ENVIRONMENT_IS_WEB=typeof window==="object";var ENVIRONMENT_IS_WORKER=typeof importScripts==="function";var ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof require==="function"&&!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_WORKER;var ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;if(ENVIRONMENT_IS_NODE){if(!Module["print"])Module["print"]=function print(x){process["stdout"].write(x+"\n")};if(!Module["printErr"])Module["printErr"]=function printErr(x){process["stderr"].write(x+"\n")};var nodeFS=require("fs");var nodePath=require("path");Module["read"]=function read(filename,binary){filename=nodePath["normalize"](filename);var ret=nodeFS["readFileSync"](filena

TypeError: Cannot read property '1' of null
  at Blockchain.initChainAndGetAddress (/usr/local/lib/node_modules/embark/lib/blockchain.js:69:45)
  at Blockchain.run (/usr/local/lib/node_modules/embark/lib/blockchain.js:41:22)
  at Object.blockchain (/usr/local/lib/node_modules/embark/lib/index.js:195:16)
  at Command.<anonymous> (/usr/local/lib/node_modules/embark/lib/cmd.js:95:17)
  at Command.listener (/usr/local/lib/node_modules/embark/node_modules/commander/index.js:301:8)
  at emitTwo (events.js:106:13)
  at Command.emit (events.js:191:7)
  at Command.parseArgs (/usr/local/lib/node_modules/embark/node_modules/commander/index.js:615:12)
  at Command.parse (/usr/local/lib/node_modules/embark/node_modules/commander/index.js:458:21)
  at Cmd.process (/usr/local/lib/node_modules/embark/lib/cmd.js:19:11)
  at Object.process (/usr/local/lib/node_modules/embark/lib/index.js:35:9)
  at Object.<anonymous> (/usr/local/lib/node_modules/embark/bin/embark:4:8)
  at Module._compile (module.js:571:32)
  at Object.Module._extensions..js (module.js:580:10)
  at Module.load (module.js:488:32)
  at tryModuleLoad (module.js:447:12)
  at Function.Module._load (module.js:439:3)
  at Module.runMain (module.js:605:10)
  at run (bootstrap_node.js:420:7)
  at startup (bootstrap_node.js:139:9)
  at bootstrap_node.js:535:3

blockchain@blockchain-VirtualBox:~/embark/embark_demo$ ^C
blockchain@blockchain-VirtualBox:~/embark/embark_demo$ sudo apt-get update
Hit:1 http://ppa.launchpad.net/ethereum/ethereum/ubuntu xenial InRelease
Get:2 http://security.ubuntu.com/ubuntu xenial-security InRelease [102 kB]
Hit:3 http://ca.archive.ubuntu.com/ubuntu xenial InRelease                          
Get:4 http://ca.archive.ubuntu.com/ubuntu xenial-updates InRelease [102 kB]        
Get:5 http://ca.archive.ubuntu.com/ubuntu xenial-backports InRelease [102 kB]                
Fetched 306 kB in 0s (317 kB/s)    
Reading package lists... Done
blockchain@blockchain-VirtualBox:~/embark/embark_demo$ cd ..
blockchain@blockchain-VirtualBox:~/embark$ sudo rm -r embark_demo/
blockchain@blockchain-VirtualBox:~/embark$ embark demo
Initializing Embark Template....
Installing packages.. this can take a few seconds
Init complete

App ready at ./embark_demo
-------------------
next steps:
-> cd ./embark_demo
-> embark blockchain or embark simulator
open another console in the same directory and run
-> embark run
For more info go to http://github.com/iurimatias/embark-framework
blockchain@blockchain-VirtualBox:~/embark$ cd embark_demo/
blockchain@blockchain-VirtualBox:~/embark/embark_demo$ embark blockchain
===============================================================================
===============================================================================
Embark Blockchain Using: Go-Ethereum (https://github.com/ethereum/go-ethereum)
===============================================================================
===============================================================================
running: geth --networkid 12301 --datadir=".embark/development/datadir" --password config/development/password account list
WARN [04-18|17:45:59] No etherbase set and no accounts found as default
already initialized
/usr/local/lib/node_modules/embark/node_modules/solc/soljson.js:1
(function (exports, require, module, __filename, __dirname) { var Module;if(!Module)Module=(typeof Module!=="undefined"?Module:null)||{};var moduleOverrides={};for(var key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var ENVIRONMENT_IS_WEB=typeof window==="object";var ENVIRONMENT_IS_WORKER=typeof importScripts==="function";var ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof require==="function"&&!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_WORKER;var ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;if(ENVIRONMENT_IS_NODE){if(!Module["print"])Module["print"]=function print(x){process["stdout"].write(x+"\n")};if(!Module["printErr"])Module["printErr"]=function printErr(x){process["stderr"].write(x+"\n")};var nodeFS=require("fs");var nodePath=require("path");Module["read"]=function read(filename,binary){filename=nodePath["normalize"](filename);var ret=nodeFS["readFileSync"](filena

TypeError: Cannot read property '1' of null
  at Blockchain.initChainAndGetAddress (/usr/local/lib/node_modules/embark/lib/blockchain.js:69:45)
  at Blockchain.run (/usr/local/lib/node_modules/embark/lib/blockchain.js:41:22)
  at Object.blockchain (/usr/local/lib/node_modules/embark/lib/index.js:195:16)
  at Command.<anonymous> (/usr/local/lib/node_modules/embark/lib/cmd.js:95:17)
  at Command.listener (/usr/local/lib/node_modules/embark/node_modules/commander/index.js:301:8)
  at emitTwo (events.js:106:13)
  at Command.emit (events.js:191:7)
  at Command.parseArgs (/usr/local/lib/node_modules/embark/node_modules/commander/index.js:615:12)
  at Command.parse (/usr/local/lib/node_modules/embark/node_modules/commander/index.js:458:21)
  at Cmd.process (/usr/local/lib/node_modules/embark/lib/cmd.js:19:11)
  at Object.process (/usr/local/lib/node_modules/embark/lib/index.js:35:9)
  at Object.<anonymous> (/usr/local/lib/node_modules/embark/bin/embark:4:8)
  at Module._compile (module.js:571:32)
  at Object.Module._extensions..js (module.js:580:10)
  at Module.load (module.js:488:32)
  at tryModuleLoad (module.js:447:12)
  at Function.Module._load (module.js:439:3)
  at Module.runMain (module.js:605:10)
  at run (bootstrap_node.js:420:7)
  at startup (bootstrap_node.js:139:9)
  at bootstrap_node.js:535:3

I am running this on an Ubuntu VM. 我在Ubuntu VM上运行它。

Does anyone have any idea why this might be breaking? 有谁知道为什么这可能会打破? I cannot find any examples of this kind of problem, anywhere. 我在任何地方都找不到此类问题的任何示例。 I am using a VM provided by my class and it doesn't seem like anyone else has run into this problem. 我正在使用班级提供的VM,似乎没有其他人遇到此问题。

Are there any resources for fixing problems like this? 是否有解决此类问题的资源?

I got the same problem. 我遇到了同样的问题。

The error is due to Blockchain.initChainAndGetAddress (/usr/local/lib/node_modules/embark/lib/blockchain.js:69:45) as shown in your error message. 错误是由于错误消息中所示的Blockchain.initChainAndGetAddress(/usr/local/lib/node_modules/embark/lib/blockchain.js:69:45)导致的。

Solution: 1. sudo gedit /usr/local/lib/node_modules/embark/lib/blockchain.js 解决方案:1. sudo gedit /usr/local/lib/node_modules/embark/lib/blockchain.js

  1. Find line 69 and you can see where the problem is. 找到第69行,您可以看到问题出在哪里。 As you can see in line 56 '// check if an account already exists, create one if not, return address', if you don not have any account, it should fall into the condition in line 58. However, in your case, the result after running line 57 is 'WARN [04-18|17:45:59] No etherbase set and no accounts found as default' and it doesn't match the no account condition. 如您在第56行中看到的“ //检查一个帐户是否已经存在,如果没有则创建一个,返回地址”,如果您没有任何帐户,则应属于第58行的条件。但是,在您的情况下,运行第57行之后的结果是“ WARN [04-18 | 17:45:59]未设置etherbase,未找到默认帐户”,并且与no account条件不匹配。 So you just have to change the condition in line 58 from 'if (result.output === undefined || result.output === '' || result.output.indexOf("Fatal") >= 0)' to 'if (result.output === undefined || result.output === '' || result.output.indexOf("Fatal") >= 0 || result.output.indexOf("No etherbase set and no accounts found as default") >= 0)'. 因此,您只需将第58行的条件从'if(result.output ===未定义|| result.output ===''|| result.output.indexOf(“ Fatal”)> = 0)'更改为'如果(result.output ===未定义|| result.output ===''|| result.output.indexOf(“ Fatal”)> = 0 || result.output.indexOf(“没有设置etherbase,也没有帐户找到默认值“)> = 0)'。

Hope this helps. 希望这可以帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM