Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Node v14 #901

Merged
merged 8 commits into from
May 28, 2020
Merged

Add support for Node v14 #901

merged 8 commits into from
May 28, 2020

Conversation

36degrees
Copy link
Contributor

See individual commits for details.

Closes #898

v4.12.0 does not support Node v14:

> Error: Node Sass does not yet support your current environment: OS X 64-bit with Unsupported runtime (83)
> For more information on which environments are supported please see:
> https://github.com/sass/node-sass/releases/tag/v4.13.1
>     at module.exports (/Users/oliverbyford/Code/govuk-prototype-kit/node_modules/node-sass/lib/binding.js:13:13)
>     at Object.<anonymous> (/Users/oliverbyford/Code/govuk-prototype-kit/node_modules/node-sass/lib/index.js:14:35)
>     at Module._compile (internal/modules/cjs/loader.js:1200:30)
>     at Object.Module._extensions..js (internal/modules/cjs/loader.js:1220:10)
>     at Module.load (internal/modules/cjs/loader.js:1049:32)
>     at Function.Module._load (internal/modules/cjs/loader.js:937:14)
>     at Module.require (internal/modules/cjs/loader.js:1089:19)
>     at require (internal/modules/cjs/helpers.js:73:18)
>     at Object.<anonymous> (/Users/oliverbyford/Code/govuk-prototype-kit/node_modules/gulp-sass/index.js:162:21)
>     at Module._compile (internal/modules/cjs/loader.js:1200:30)
> gulp exited with code 1
Prompt's dependency winston is causing a warning in the console:

> (node:15613) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency

This has been raised as an issue on prompt's GitHub repo [1] but given the last release of prompt was 4 years ago, I think it makes sense to move away to an alternative that's actively maintained.

[1]: flatiron/prompt#199
This fixes a type error that's being thrown by Object.writeFileSync in Node v14:

> UnhandledPromiseRejectionWarning: TypeError [ERR_INVALID_ARG_TYPE]: The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView. Received type number (3001)
>     at Object.writeFileSync (fs.js:1380:5)
>     at /Users/oliverbyford/Code/govuk-prototype-kit/lib/utils.js:99:14
>     at processTicksAndRejections (internal/process/task_queues.js:97:5)
Prompt's dependency winston is causing a warning in the console:

> (node:15613) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency

This has been raised as an issue on prompt's GitHub repo [1] but given the last release of prompt was 4 years ago, I think it makes sense to move away to an alternative that's actively maintained.

[1]: flatiron/prompt#199
> DeprecationWarning: Deep requiring like `const uuidv4 = require('uuid/v4');` is deprecated as of uuid@7.x. Please require the top-level module when using the Node.js CommonJS module or use ECMAScript Modules when bundling for the browser. See https://github.com/uuidjs/uuid#deep-requires-now-deprecated for more information.
Node v14 will become the active LTS release in October 2020, at which point we should recommend that users start installing it. (v12 will remain supported under LTS until 30 April 2022)

Until then, some users may only be able to install v14 as the current/latest version – for example, if a department provides Node through a managed software centre – so we should make sure it works with it.
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-prototype-kit-pr-901 May 26, 2020 14:57 Inactive
Both places that used prompt have been updated to use inquirer instead, so prompt can now be removed.
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-prototype-kit-pr-901 May 26, 2020 15:00 Inactive
@36degrees 36degrees changed the title Support Node v14 Add support for Node v14 May 27, 2020
Copy link
Member

@hannalaakso hannalaakso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@36degrees This is nice, just left a small comment.

lib/usage_data.js Show resolved Hide resolved
@36degrees 36degrees merged commit 0fa252a into master May 28, 2020
@36degrees 36degrees deleted the node-v14-support branch May 28, 2020 09:41
@36degrees 36degrees mentioned this pull request Jun 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ensure Prototype Kit works with Node 14 (Fermium)
3 participants