[NextJS]`yarn dev`命令抛出错误:Assert`args[0]-> IsInt 32()'失败

ix0qys7i  于 2023-06-22  发布在  Yarn
关注(0)|答案(1)|浏览(138)

在运行yarn dev进行NextJS本地开发时,我得到了以下错误输出:

/opt/homebrew/Cellar/node/19.9.0/bin/node[8717]: ../src/tcp_wrap.cc:155:static  void node::TCPWrap::New(const FunctionCallbackInfo<v8::Value> &): Assertion `args[0]->IsInt32()' failed.
[/opt/homebrew/Cellar/node/19.9.0/bin/node]
51: 0x1044f3d70 node::crypto::TLSWrap::Cycle() [/opt/homebrew/Cellar/node/19.9.0/bin/node]
52: 0x1044f229c node::crypto::TLSWrap::OnStreamRead(long, uv_buf_t const&) [/opt/homebrew/Cellar/node/19.9.0/bin/node]
53: 0x10448a48c node::LibuvStreamWrap::OnUvRead(long, uv_buf_t const*) [/opt/homebrew/Cellar/node/19.9.0/bin/node]
54: 0x10448a13c node::LibuvStreamWrap::ReadStart()::$_1::__invoke(uv_stream_s*, long, uv_buf_t const*) [/opt/homebrew/Cellar/node/19.9.0/bin/node]
55: 0x106d32ff0 uv__stream_io [/opt/homebrew/Cellar/libuv/1.44.2/lib/libuv.1.dylib]
56: 0x106d3a1e0 uv__io_poll [/opt/homebrew/Cellar/libuv/1.44.2/lib/libuv.1.dylib]
57: 0x106d2a7bc uv_run [/opt/homebrew/Cellar/libuv/1.44.2/lib/libuv.1.dylib]
58: 0x1042fd8d8 node::SpinEventLoopInternal(node::Environment*) [/opt/homebrew/Cellar/node/19.9.0/bin/node]
59: 0x1044025c0 node::NodeMainInstance::Run(node::ExitCode*, node::Environment*) [/opt/homebrew/Cellar/node/19.9.0/bin/node]
60: 0x104402344 node::NodeMainInstance::Run() [/opt/homebrew/Cellar/node/19.9.0/bin/node]
61: 0x10438acf4 node::LoadSnapshotDataAndRun(node::SnapshotData const**, node::InitializationResultImpl const*) [/opt/homebrew/Cellar/node/19.9.0/bin/node]
62: 0x10438ae90 node::Start(int, char**) [/opt/homebrew/Cellar/node/19.9.0/bin/node]
63: 0x18640fe50 start [/usr/lib/dyld]
error Command failed with signal "SIGABRT".

尝试过的事情:

  1. yarn installyarn cache clean多次。
  2. package.json也是如此。
    1.尝试将节点版本降级为14和16。
    1.恢复到以前的工作分支。
    情境:5。yarn build生成的输出在部署时运行良好,因此问题与dev-related packages有关。
2g32fytz

2g32fytz1#

我一直没能解决这个问题但我找到了一个变通方法:

yarn build && yarn start

相关问题