简体   繁体   English

Node.js RangeError:超过最大调用堆栈大小 我不知道我的程序在哪里卡在循环中?

[英]Node.js RangeError: Maximum call stack size exceeded I dont get where my program get stuck in the loop?

Hello everyone I'm working on my udemy course and i have an issue when i compile with node.js solidity file with my compiler using windows terminal machine... this is the error I get:大家好,我正在学习我的udemy课程,当我使用windows终端机编译node.jssolidity文件时遇到问题......这是我得到的错误:

compiler error message编译器错误信息

and to be clear ill show my solidity code and JavaScript so you guys have better view and would be nice if you can just explain me more what im doing wrong... sorry i may dont give as much info but i hope u guys do understand my problem.并且要清楚地显示我的可靠代码和 JavaScript 所以你们有更好的看法,如果你能解释一下我做错了什么会很好......对不起,我可能没有提供太多信息,但我希望你们能理解我的问题。

solidity and JavaScript code坚固性和 JavaScript 代码

compile.js file:编译.js 文件:

const path = require('path');

// fs = file system module
const fs = require('fs');

const solc = require('solc');

// give a path to a compiler the file you want to compile:
// "__dirname" means it will start the path from the files folder root in this project root folder is "Inbox"

const inboxPath = path.resolve(__dirname, 'contracts', 'Inbox.sol');
const source = fs.readFileSync(inboxPath, 'utf8');

console.log(solc.compile(source, 1));

and solidity.sol file和solidity.sol 文件

// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.4.17;

contract Inbox{

    string public message;

    constructor(string initialMessage) public {

            message = initialMessage;
    }

    function setMessage(string newMessage) public {
        message = newMessage;
    }
}

You need to pass a JSON-encoded options object into the compile() function - not just the source code (that's what your current code is doing).您需要将 JSON 编码的options object 传递到compile() function - 而不仅仅是源代码(这就是您当前的代码正在执行的操作)。

You can find code example in the solc package readme .您可以在solc package 自述文件中找到代码示例。

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

相关问题 Node.js RangeError:超出最大调用堆栈大小 - Node.js RangeError: Maximum call stack size exceeded RangeError:超出了 Node.js 的最大调用堆栈大小 - RangeError: Maximum call stack size exceeded for Node.js RangeError:超出最大调用堆栈大小-Node.js - RangeError: Maximum call stack size exceeded - Node.js 日期数组在node.js中-我有一个错误:RangeError:超出最大调用堆栈大小 - Array of dates In node.js - I have an error : RangeError: Maximum call stack size exceeded 获取rangeError超出最大调用堆栈大小 - get rangeError Maximum call stack size exceeded 为什么我会收到“RangeError:超出最大调用堆栈大小”? - Why do i get “RangeError: Maximum call stack size exceeded”? Node.Js 模块中变量和模块的范围导致 RangeError:超出最大调用堆栈大小 - Scope of variables and modules in Node.Js modules leading to RangeError: Maximum call stack size exceeded 聚合范围错误:超出最大调用堆栈大小(Node.js,猫鼬) - Aggregation RangeError: Maximum call stack size exceeded (Node.js, Mongoose) node.js / Express抛出'RangeError:在高负载下超过'最大调用堆栈大小 - node.js / Express throws 'RangeError: Maximum call stack size exceeded' under high load jQuery当我单击时,我得到一个错误Uncaught RangeError:超出最大调用堆栈大小 - JQuery When I click I get an error Uncaught RangeError: Maximum call stack size exceeded
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM