首页 > 解决方案 > TypeError [ERR_INVALID_REPL_INPUT] [ERR_INVALID_REPL_INPUT]: `uncaughtException` 的监听器不能在 REPL 中使用

问题描述

我正在尝试测试我的第一个区块链应用程序。这是我的代码

var Contest = artifacts.require("./Contest.sol");
contract("Contest",function(accounts){
//to check if getting initialized correctly
it("initializes with two contestants", function(){
    return Contest.deployed().then(function(instance){
        return instance.contestantsCount();
    }).then(function(count){
        assert.equal(count,2);
    });
});
});

但我收到此错误:

TypeError [ERR_INVALID_REPL_INPUT] [ERR_INVALID_REPL_INPUT]: Listeners 
for `uncaughtException` cannot be used in the REPL

环境

Operating System: Microsoft Windows
Truffle v5.0.2 (core: 5.0.2)
Solidity v0.5.0 (solc-js)
Node v14.17.1

标签: blockchaintruffleganache

解决方案


不应该有逗号。它应该是:

X = faces[::-1]
y = faces[:-1:]

推荐阅读