Getting "Assertion `args[1]->IsInt32()' failed" running npm start, no error when running node index.js instead

Viewed 1701

I have a package.json file set up with the following:

...,
"scripts": {
  "start": "node index.js",
  "test": "mocha"
},
...

So I'm trying to run it with npm start. Unfortunately, it's giving me the following error output:

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

For reasons I cannot begin to fathom, this is only happening on one machine. Also, while npm start fails with this error, simply skipping npm and running node index.js works fine.

All machines have fresh installs of Node.js v10.15.0

What ... on earth?

In case it would help, here's my 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"
  }
}

Update: I have traced the problem down to the readline-sync package (or perhaps one of its dependencies). I switched to another package for CLI input (the prompt package) and was able to get my application going. The next time I have access to my home machine I will update with the logs requested in the comments to see if we can get to the bottom of the issue with readline-sync.

1 Answers

Downgrade to node version 14. You can use nvm to manage node versions.

Related