我有一个package.json
文件,设置如下:
...,
"scripts": {
"start": "node index.js",
"test": "mocha"
},
...
因此,我尝试使用npm start
运行它。不幸的是,它给了我以下错误输出:
npm[7444]: src\node_file.cc:1599: Assertion `args[1]->IsInt32()' failed.
1: 00007FF75D44121A v8::internal::GCIdleTimeHandler::GCIdleTimeHandler+4810
2: 00007FF75D41A5B6 node::MakeCallback+4518
3: 00007FF75D41A66F node::MakeCallback+4703
4: 00007FF75D3DF663 uv_loop_fork+34595
5: 00007FF75DC45782 v8::internal::OptimizingCompileDispatcher::Unblock+60562
6: 00007FF75DC46C1D v8::internal::OptimizingCompileDispatcher::Unblock+65837
7: 00007FF75DC45C79 v8::internal::OptimizingCompileDispatcher::Unblock+61833
8: 00007FF75DC45B5B v8::internal::OptimizingCompileDispatcher::Unblock+61547
9: 000002E4183DC5C1
npm ERR! code ELIFECYCLE
npm ERR! errno 134
npm ERR! c4sk@1.0.0 start: `node index.js`
npm ERR! Exit status 134
npm ERR!
npm ERR! Failed at the c4sk@1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Steven\AppData\Roaming\npm-cache\_logs\2019-01-11T04_52_55_255Z-debug.log
出于某种原因,我无法开始了解,这仅在一台计算机上发生。另外,虽然npm start
失败并出现此错误,但是只需跳过npm并运行node index.js
即可正常工作。
所有计算机都重新安装了Node.js v10.15.0
到底是什么...
以防万一,这是我的package.json
:
{
"name": "c4sk",
"version": "1.0.0",
"description": /**/,
"main": "index.js",
"scripts": {
"start": "node index.js",
"test": "mocha"
},
"repository": {
"type": "git",
"url": "/**/"
},
"author": "Steven Kitzes",
"license": "ISC",
"bugs": {
"url": "/**/"
},
"homepage": "/**/",
"devDependencies": {
"mocha": "^5.2.0"
},
"dependencies": {
"readline-sync": "^1.4.9"
}
}
更新:我已将问题归结为readline-sync
程序包(或其依赖项之一)。我切换到另一个用于CLI输入的软件包(prompt
软件包),并且能够使我的应用程序正常运行。下次我可以使用家用计算机时,我将使用注释中要求的日志进行更新,以查看是否可以通过readline-sync
来解决问题。