运行metamascara时出现的一些错误
The difference between mascara and the extension
Mascara Is in alpha and some of it's behaviors are still undocumented.
1.页面控制台报错
运行eth.accounts出错:
(node) warning: possible EventEmitter memory leak detected. 11 listeners added. Use emitter.setMaxListeners() to increase limit.
383.EventEmitter.addListener @ wallet.metamask.io/background.js:
好像是要我添加监听吧
解决办法好像是在运行文件时加上 --trace-warnings(打印进程警告的堆栈跟踪(包括废弃警告))命令行选项即可,但是后面发现好像也不行:
http://nodejs.cn/api/cli.html#cli_trace_warnings
node main.js --trace-warnings
并不知道原因,之后查找到了原因,参考:https://segmentfault.com/a/1190000002964630
EventEmitter
在nodejs中有一个EventEmitter类,目的是实现各种事件的event处理。当需要指定绑定事件时,可以使用EventEmitter类的on方法或addListener方法.这两个方法实现原理相同,只是名称不一样.这两个方法都有两个参数,第一个参数为指定事件名 第二个参数为该事件的事件处理函数:
var http = require('http');
var server = http.createServer();
server.addListener('request', function(req, res) {
console.log('addListener');
res.end();
})
server.on('request', function(req, res) {
console.log('on');
res.end();
})
setMaxListeners()
在默认情况下,同一个指定的事件,最多可以绑定10个事件处理函数。也可以通过下面的方法修改:
var http = require('http');
var server = http.createServer();
server.setMaxListeners(5);
server.addListener('request', function(req, res) {
console.log('mark');
res.end();
})
也可以指定最多绑定5个,当绑定数超出时,启动nodejs时,会有相应的错误提示。
(node) warning: possible EventEmitter memory leak detected. 6 request listeners added. Use emitter.setMaxListeners() to increase limit.
Trace
at Server.addListener (events.js:179:15)
at Object.<anonymous> (/Users/demacia/nodejs-mark/event_emitter.js:41:8)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Function.Module.runMain (module.js:501:10)
at startup (node.js:129:16)
at node.js:814:
然后查到了有一个插件编译并监测到这个warning:https://github.com/niftylettuce/max-listeners-exceeded-warning
可以看看
后面发现好像是浏览器的问题,之前使用的是chrome,后面改成safari后就不再报这样的错了,也不知道为什么,后面查查看??????????
2.错误:
{ Error: Plugin/Preset files are not allowed to export objects, only functions. In /Users/user/out/node_modules/babel-preset-stage-/lib/index.js while parsing file: /Users/user/out/mascara/example/app.js
可能是版本问题:
npm install babel-core@6.24. --save-dev
"babel-preset-stage-0": "^6.24.1"
都要版本6
Error: Cannot find module '@babel/core'
babelify@ requires Babel .x (the package '@babel/core'). If you'd like to use Babel 6.x ('babel-core'), you should install 'babelify@'.
原来 npm install @babel/core和npm install babel-core是一样的,只是版本的不同两者对应的babelify版本也不同
3.问题:
{ [Error: ENOENT: no such file or directory, open '/Users/user/out/node_modules/react-select/dist/react-select.css' while parsing file: /Users/user/out/ui/css.js] 还有react-tooltip-component.css
所以就先将使用到他们的地方先注释掉,(/Users/user/out/ui/css.js)和(/Users/user/out/old-ui/css.js)
4.页面上出错
Cannot GET /favicon.ico
解决方法:参考https://blog.csdn.net/u012217533/article/details/46368251
在页面中加上这么一行代码:
<span style="white-space:pre"> </span><link href="http://www.lituanmin.com/favicon.ico" rel="icon" type="image/x-icon" />
5.当我想要调用sendTransaction来看看到底metamascara会不会弹出一个端口,但是下面的data处出了一个错:
web3.eth.sendTransaction({
from: '0x7DdaD6a67544efB0c51808c77009a7B98Cc81630',
to: '0x3B896Fb3e31fC9B91921d19B8C7271d1c3af5B35',
value: '',
data:'i want to be your friend'//这里出了错
})
出错:Uncaught Error: The data field must be HEX encoded data.
就是data的格式是处理后变成‘0x...’的格式的
所以将data改成web3.utils.sha3('i want to be your friend')
6.然后又出现了下面的这个问题:
Error: Returned error: Unknown address - unable to sign transaction for this address: "0x7ddad6a67544efb0c51808c77009a7b98cc81630"
是因为我没有打开线上钱包,为这个账户解锁
运行metamascara时出现的一些错误的更多相关文章
- python运行selenium时出现的一个错误总结
1.SettingWithCopyWarning: A value is trying to be set on a copy of a slice from a DataFrame 场景:运用pan ...
- JMeter导入jmx运行脚本时出现这样的错误jmeter.save.SaveService: Conversion error com.thoughtworks.xstream.converters.ConversionException:
2016/12/20 13:51:55 ERROR - jmeter.save.SaveService: Conversion error com.thoughtworks.xstream.conve ...
- Python运行Google App Engineer时出现的UnicodeDecodeError错误解决方案
#Python运行Google App Engineer时出现的UnicodeDecodeError错误解决方案 ##问题描述 使用Python2.7.x运行GAE时有时会报这个错误 ```py ...
- ArcMap运行时出现Runtime Error错误的解决方案
运行ArcMap时弹出错误提示:“Microsoft Visual C++ Runtime Library. Runtime 1.开始->运行->regsvr32 "C:\Pro ...
- IDEA里运行程序时出现Error:scalac:error while loading JUnit4 , Scala signature JUnit4 has wrong version错误的解决办法(图文详解)
不多说,直接上干货! 问题详情 当我们在运行程序时,出现Error:scalac:error while loading JUnit4 , Scala signature JUnit4 has wro ...
- linux 环境下运行STS时 出现must be available in order to run STS
linux 环境下运行ECLIPSE时 出现 “ A Java Runtime Environment (JRE) or Java Development Kit (JDK) must be avai ...
- eclipse中配置tomcat后,运行jsp时出现Server Tomcat v7.0 Server at localhost failed to start.
最近在进行jsp开发学习,在配置上还是遇到很多问题. 在连接好数据库后,写了第一个jsp测试页面,结果在运行eclipse中运行toamcat时出现了错误提示:Server Tomcat v7.0 S ...
- 无法在Web服务器上启动调试,与Web服务器通信时出现身份验证错误
问题描述: 我使用的是修改hosts,模拟真实网址来进行调试的.具体是这样的:我修改hosts文件,把某个域名,如www.163.com映射为127.0.0.1,然后在IIS信息管理器中,创建一个网站 ...
- 使用Sqoop从mysql向hdfs或者hive导入数据时出现的一些错误
1.原表没有设置主键,出现错误提示: ERROR tool.ImportTool: Error during import: No primary key could be found for tab ...
随机推荐
- IDEA中上传项目到GIt
一.先创建一个git仓库 二.然后在右键项目pull 三.add 最后提交: 完成
- 关于List、Map循环时,进行删除的结论
通过一些测试发现,List 使用for(int i=0;i<list.size();i++),可以正常删除,不会抛出异常:使用增强for循环,for(String x:list)会抛出Concu ...
- 青蛙的约会(poj1061+欧几里德)
青蛙的约会 Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 94174 Accepted: 17412 Descripti ...
- 初学HTML-4
img标签:<img src=" "> src——source缩写,告诉img标签需要显示的图片名称 属性:width:宽度 height:高度.若未指定宽和高,则 ...
- JS 提升 p4
提示不多说,记住几个要点: 1.变量和函数都会提升,如下 a = 2; var a ; console.log(a); fn(); function fn(){ console.log(1); } 2 ...
- 【代码笔记】iOS-mp3的播放
一,工程图. 二,代码. RootViewController.h #import <UIKit/UIKit.h> //加入AVFoundation.framework头文件 #impor ...
- Django. No changes detected when "makemigrations"
在修改了models.py后,有些用户会喜欢用python manage.py makemigrations生成对应的py代码. 但有时执行python manage.py makemigration ...
- [Android] 对自定义图片浏览器经常内存溢出的一些优化
首先关于异步加载图片可以参见 夏安明 的博客:http://blog.csdn.net/xiaanming/article/details/9825113 这篇文章最近有了新的更改,大概看了一下,内容 ...
- 【Python】读取excel数据
'''python3读取excle数据''' import xlrd workbook = xlrd.open_workbook(r'test.xls', encoding_override='gbk ...
- 【Python】多线程
import threading import time class myThread (threading.Thread): #继承父类threading.Thread def __init__(s ...