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


(Igor Galić) #1

Is it possible to upgrade a project to node v10?
One concrete example i’m currently stuck with is: https://github.com/magne4000/quassel-webserver/

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??


(Markus Tacker) #2

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


(Igor Galić) #3

Yes, that actually makes perfect sense — given that the author of net-browserify-alt did exactly that :smile: https://github.com/magne4000/quassel-webserver/issues/267


(Igor Galić) #4

So! I just learned, from npm audit about:

npm update pkg-name --depth 5

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


(system) #5

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