npm Community Forum (Archive)

The npm community forum has been discontinued.

To discuss usage of npm, visit the GitHub Support Community.

How to upgrade a project to node 10 (which has nan in its dependency tree;)

Is it possible to upgrade a project to node v10?
One concrete example i’m currently stuck with is:

The package.json looks simple enough:

  "engines": {
    "node": ">= 4"
  "dependencies": {
    "body-parser": "^1.16.0",
    "commander": "^2.9.0",
    "cookie-parser": "~1.4.3",
    "express": "^4.14.1",
    "less": "^2.7.2",
    "less-middleware": "^2.2.0",
    "libquassel": "~2.1.8",
    "morgan": "^1.8.0",
    "net-browserify-alt": "^1.1.0",
    "pug": "^2.0.0-beta11",
    "serve-favicon": "~2.3.2",
    "untildify": "^3.0.2"
  "optionalDependencies": {
    "httpolyglot": "~0.1.2"

but installing it on node 10 is impossible due to the versions,

for instance, "net-browserify-alt": "^1.1.0" depends on "bufferutil": "^2.0.0", which depends on "bufferutil": "^2.0.0", which doesn’t work on node 10, due to a missing function

The list goes on, and always boils down to that.

So, is there a way to force nan>=2.10 from the outside (package.json?) — and how does that work wrt to packages such as net-browserify-alt which are effectively abandoned??

You could fork the dependency and update it to use nan>=2.10, and use the fork in your project.

Yes, that actually makes perfect sense — given that the author of net-browserify-alt did exactly that :smile:

So! I just learned, from npm audit about:

npm update pkg-name --depth 5

which probably would’ve done what i wanted :sweat_smile: