![](/img/trans.png)
[英]What is causing the Node.js "MaxListenersExceededWarning" warning?
[英]What is causing node.js to crash?
不熟悉 javascript/node.js,我无法让我的脚本运行:
import { IDS, MangoGroup, MangoClient } from '@blockworks-foundation/mango-client';
import { Account, Connection, PublicKey } from '@solana/web3.js';
import { Market } from '@project-serum/serum';
import { readFileSync } from 'fs';
setInterval(function () {
console.log("timer that keeps nodejs processing running");
}, 1000 * 60 * 60);
如您所见,此脚本基本上是空白的。 仅进口导致它失败。 如果我删除导入,那么 node.js 会继续运行。
有什么问题?
编辑:这是 output:要点
如果您尝试使用 nodejs 运行脚本,请在 package.json 文件中添加“type”:“module” 。 我希望这能解决你的问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.