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

Proposal: add engines to package.json website/template #7517

Closed
3 of 7 tasks
johnnyreilly opened this issue May 28, 2022 · 1 comment · Fixed by #7520
Closed
3 of 7 tasks

Proposal: add engines to package.json website/template #7517

johnnyreilly opened this issue May 28, 2022 · 1 comment · Fixed by #7520
Labels
better engineering Not a bug or feature request

Comments

@johnnyreilly
Copy link
Contributor

johnnyreilly commented May 28, 2022

Have you read the Contributing Guidelines on issues?

Prerequisites

  • I'm using the latest version of Docusaurus.
  • I have tried the npm run clear or yarn clear command.
  • I have tried rm -rf node_modules yarn.lock package-lock.json and re-installing packages.
  • I have tried creating a repro with https://new.docusaurus.io.
  • I have read the console error message carefully (if applicable).

Description

Hey all,

Sorry, not a bug but so minor I couldn't call it a feature.

Upgrading to beta 21 introduced a minimum node.js version of 16. This broke my build which was using 14. I was able to resolve this by adding:

  "engines": {
    "node": ">=16"
  }

To my package.json which I wrote about here:

https://blog.johnnyreilly.com/2022/05/28/azure-static-web-apps-node-16-oryx

And you can see the PR here: johnnyreilly/blog.johnnyreilly.com#228

Would it be good to add this engines property to the create templates? This would fix the issue for folk using Oryx based builds and would give an explicit steer as to what node version Docusaurus requires to build.

https://github.com/facebook/docusaurus/blob/main/packages/create-docusaurus/templates/classic/package.json

Reproducible demo

No response

Steps to reproduce

Run a build with node 14 installed

Expected behavior

See description

Actual behavior

See description

Your environment

  • Public source code:
  • Public site URL:
  • Docusaurus version used:
  • Environment name and version (e.g. Chrome 89, Node.js 16.4): node 14
  • Operating system and version (e.g. Ubuntu 20.04.2 LTS):

Self-service

  • I'd be willing to fix this bug myself.
@johnnyreilly johnnyreilly added bug An error in the Docusaurus core causing instability or issues with its execution status: needs triage This issue has not been triaged by maintainers labels May 28, 2022
@Josh-Cena Josh-Cena added better engineering Not a bug or feature request and removed bug An error in the Docusaurus core causing instability or issues with its execution status: needs triage This issue has not been triaged by maintainers labels May 28, 2022
@Josh-Cena
Copy link
Collaborator

I'm open to adding this. This is the last time we bump our Node version before the official release, so we shouldn't worry about users having outdated engines field in their package.json anymore.

@slorber slorber changed the title Proposal: add engines to package.json Proposal: add engines to package.json website/template Jun 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
better engineering Not a bug or feature request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants