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

Update Node to Active LTS version v16 (Gallium) #2110

Merged
merged 2 commits into from
Apr 25, 2022
Merged

Conversation

domoscargin
Copy link
Contributor

@domoscargin domoscargin commented Mar 16, 2022

Node.js v14 has been in maintenance mode from 19 October 2021. v16 is the active LTS version.

This in turns updates NPM to v8, meaning our lockfile has change to lockfileVersion 2

This is an internal change that affects development, testing and deployment.

Closes #2021

@netlify
Copy link

netlify bot commented Mar 16, 2022

You can preview this change here:

Name Link
🔨 Latest commit c30b9db
🔍 Latest deploy log https://app.netlify.com/sites/govuk-design-system-preview/deploys/6260328897f290000ba85353
😎 Deploy Preview https://deploy-preview-2110--govuk-design-system-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@querkmachine
Copy link
Member

Unfortunately updating to Node 16.x seems to prevent building on Apple Silicon Macs, with node-sass complaining that it doesn't have a version compatible with that version/architecture combination. That tracks, as node-sass doesn't have any arm64 architecture support, and would normally run under Rosetta.

Weirdly, it doesn't complain under Node 14.x, despite node-sass also not having a Node 14/arm64 version.

Error: Node Sass does not yet support your current environment: OS X Unsupported architecture (arm64) with Node.js 16.x
For more information on which environments are supported please see:
https://github.com/sass/node-sass/releases/tag/v7.0.1
    at module.exports (/Users/kimberly.grey/Sites/govuk-design-system/node_modules/node-sass/lib/binding.js:13:13)
    at Object.<anonymous> (/Users/kimberly.grey/Sites/govuk-design-system/node_modules/node-sass/lib/index.js:13:35)
    at Module._compile (node:internal/modules/cjs/loader:1103:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1155:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at /Users/kimberly.grey/Sites/govuk-design-system/node_modules/metalsmith-sass/lib/index.js:4:14
    at Object.<anonymous> (/Users/kimberly.grey/Sites/govuk-design-system/node_modules/metalsmith-sass/lib/index.js:135:2)

I also get this (similarly nonsensical) warning running npm install under Node 16.x, which isn't present when running it under Node 14.x.

npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'metalsmith-tagcleaner@0.0.2',
npm WARN EBADENGINE   required: { node: '>=4.00' },
npm WARN EBADENGINE   current: { node: 'v16.14.0', npm: '8.3.1' }
npm WARN EBADENGINE }

This occur regardless of what terminal application or shell I use, so it doesn't appear to be influenced by one or more reporting incorrect environment information.

@domoscargin domoscargin marked this pull request as draft March 22, 2022 08:11
@domoscargin
Copy link
Contributor Author

There are no plans to support M1 with the node-sass compiler. You can switch to the sass compiler instead.

dlmanning/gulp-sass#803 (comment)

@domoscargin
Copy link
Contributor Author

domoscargin commented Mar 22, 2022

I got this working locally by running:

nvm use
npm uninstall node-sass -g && npm cache clean -force && npm install node-sass
nvm use
npm install

It might be worth deleting the node_modules directory first as well.

But I'm also getting the metalsmith-tagcleaner warning. That package is 6 years old!

@querkmachine
Copy link
Member

Unfortunately still not working for me after trying the uninstall/clean/install commands, same error as before.

@domoscargin
Copy link
Contributor Author

@querkmachine and I managed to get this working by following my updated comment above.

Node.js v14 has been in maintenance mode from 19 October 2021. v16 is the active LTS version.

This in turns updates NPM to v8, meaning our lockfile has change to [`lockfileVersion` 2](https://docs.npmjs.com/cli/v8/configuring-npm/package-lock-json#lockfileversion)

This is an internal change that affects development, testing and deployment.
If a user has previously installed locally using Node 14 and lower on their M1 machine, they will encounter `node-sass` errors when running `npm install` after pulling this commit.

This adds documentation to deal with those errors.

This should only affect developers.
@domoscargin domoscargin added documentation User requests new documentation or improvements to existing documentation tooling dependencies Pull requests that update a dependency file labels Apr 20, 2022
@domoscargin domoscargin marked this pull request as ready for review April 20, 2022 16:19
@domoscargin domoscargin requested a review from a team April 20, 2022 16:23
Copy link
Member

@lfdebrux lfdebrux left a comment

Choose a reason for hiding this comment

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

🚢 🚀 🎉

@domoscargin domoscargin merged commit 2756ad7 into main Apr 25, 2022
@domoscargin domoscargin deleted the bk-update-node-lts branch April 25, 2022 07:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file documentation User requests new documentation or improvements to existing documentation tooling
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update Node.js to active LTS version
3 participants