Nuxt.js: add support for node 6

Created on 6 Mar 2018  路  8Comments  路  Source: nuxt/nuxt.js

In some environments, it's difficult/impossible to upgrade node versions (in my case, AWS Lambda).

Note that while Node 4.x is end-of-lifing next month that Node 6.x is still supported, and should be supported by packages. see https://github.com/nodejs/Release/blob/master/README.md

I see that other's ran into this issue before:
https://github.com/nuxt/nuxt.js/issues/2395
https://github.com/nuxt/nuxt.js/issues/2927

and that code was even added to check for this:
https://github.com/nuxt/nuxt.js/pull/2718

In my case, I made a new re-package of nuxt which does some transpilation:
https://github.com/phlogisticfugu/nuxtjs-node6

I'd propose:

  • a new ./node6/index.js bundle, made via rollup, during npm prepare, which transpiles, with babel shims/runtime-module a version of the nuxt library that runs on node6

    • then in node6 environments, one can use: const { Nuxt } = require('nuxt/node6')

  • a node6.rollup.config.js to configure that build, and addition of rollup and appropriate plugins to devDependencies
  • a decrease in the required package.json version
  • transpiled bin scripts: bin/nuxt-node6 built to permit executing CLI commands in a node6 environment.

This question is available on Nuxt.js community (#c2562)
discussion

Most helpful comment

A legacy build is coming with nuxt 2 (and nuxt-edge). Will provide better info soon.

All 8 comments

Hmm could also be built into automated tests, and the CI configuration

Also interested in this, primarily for AWS Lambda.

A legacy build is coming with nuxt 2 (and nuxt-edge). Will provide better info soon.

awesome, so the nuxt 2 legacy build will work with node6? Thanks @pi0 . I'd love to help out if folks are open to that.

oh awesome that AWS Lambda supports Node 8 now! That solves my most immediate concern.

But still, it'd be great to have nuxt work on slightly older node versions. which branch/where is that work happening?

The latest build of nuxt-edge supports Node 6.x again by automatically falling back to legacy dist. Useful for Google Cloud Functions users.

image

PS: Don't forget to add babel-polyfill dependency to your project if you need legacy build.

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

surmon-china picture surmon-china  路  3Comments

o-alexandrov picture o-alexandrov  路  3Comments

danieloprado picture danieloprado  路  3Comments

mattdharmon picture mattdharmon  路  3Comments

lazycrazy picture lazycrazy  路  3Comments