"npm install" causing segfault

I’m encountering an issue on one of my servers: npm install is causing a segfault.

package.json file:

{
  "name": ".....",
  "version": "0.0.0",
  "description": "",
  "main": "index.js",
  "devDependencies": {
    "@babel/cli": "^7.2.3",
    "@babel/core": "^7.0.0",
    "@babel/plugin-external-helpers": "^7.2.0",
    "@babel/plugin-proposal-class-properties": "^7.3.4",
    "@babel/plugin-transform-runtime": "^7.3.4",
    "@babel/preset-env": "^7.3.4",
    "@babel/preset-react": "^7.0.0",
    "@babel/preset-typescript": "^7.3.3",
    "assets-webpack-plugin": "~3.9.10",
    "babel-core": "^7.0.0-bridge.0",
    "babel-loader": "8.0.5",
    "cross-env": "^5.2.0",
    "exports-loader": "~0.7.0",
    "expose-loader": "~0.7.5",
    "fork-ts-checker-webpack-plugin": "^1.0.0",
    "imports-loader": "~0.8.0",
    "prettier": "1.16.4",
    "typescript": "^3.3.3333",
    "webpack": "~4.29.6",
    "webpack-cli": "^3.2.3"
  },
  "author": "Daniel Lo Nigro <daniel@dan.cx> (https://dan.cx/)",
  "scripts": {
    "build-dev": "cross-env NODE_ENV=development webpack -d --mode development",
    "build-prod": "cross-env NODE_ENV=production webpack -p --mode production",
    "check-types": "tsc",
    "watch": "cross-env NODE_ENV=development webpack --progress --colors --watch -d",
  },
  "dependencies": {
    "@babel/runtime": "^7.0.0",
    "@types/classnames": "^2.2.7",
    "@types/facebook-js-sdk": "^3.2.0",
    "@types/flux": "^3.1.8",
    "@types/google.analytics": "^0.0.39",
    "@types/react": "^16.8.6",
    "@types/react-dom": "^16.8.2",
    "array.prototype.find": "~1.0.0",
    "classnames": "^2.1.5",
    "fbemitter": "^2.0.0",
    "flux": "~2.1.1",
    "react": "15.4.0",
    "react-autocomplete": "Daniel15/react-autocomplete#fb812e2dd01b7b30be4da6380912cf5ffa24a9f8",
    "react-dom": "15.4.0"
  }
}

Full output: https://gist.github.com/Daniel15/4d77a58e795196e00d87db0b60fc108f
OS: Debian Linux (Buster)
Node.js version: v10.15.2
npm version: 6.9.0

Any ideas?

Got a backtrace using gdb:

#0  0xb703023b in node::fs::FSReqWrap::~FSReqWrap() () from /usr/lib/i386-linux-gnu/libnode.so.64
#1  0xb70214b3 in node::fs::FSReqAfterScope::~FSReqAfterScope() () from /usr/lib/i386-linux-gnu/libnode.so.64
#2  0xb7021f5e in node::fs::AfterInteger(uv_fs_s*) () from /usr/lib/i386-linux-gnu/libnode.so.64
#3  0xb6af0690 in uv.work_done () from /usr/lib/i386-linux-gnu/libuv.so.1
#4  0xb6af477e in ?? () from /usr/lib/i386-linux-gnu/libuv.so.1
#5  0xb6b04468 in uv.io_poll () from /usr/lib/i386-linux-gnu/libuv.so.1
#6  0xb6af5146 in uv_run () from /usr/lib/i386-linux-gnu/libuv.so.1
#7  0xb6ff0e96 in node::Start(v8::Isolate*, node::IsolateData*, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&) () from /usr/lib/i386-linux-gnu/libnode.so.64
#8  0xb6feeef2 in node::Start(int, char**) () from /usr/lib/i386-linux-gnu/libnode.so.64
#9  0x08049158 in main ()

I wonder if it’s a Node.js bug rather than an npm bug…

1 Like

I switched from Node.js 10.x in the Debian repo to Node.js 8.x in the NodeSource repo, and it works fine. Will likely file a bug against Debian.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.