Repository navigation
Description
Have you read the Contributing Guidelines on issues?
- I have read the Contributing Guidelines on issues.
Prerequisites
- I'm using the latest version of Docusaurus.
- I have tried the
npm run clearoryarn clearcommand. - I have tried
rm -rf node_modules yarn.lock package-lock.jsonand 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
Cannot create site using npx create-docusaurus using node v 20.6.0 - fails with common.register is not a function.
This works if reverting back to node LTS.
Reproducible demo
No response
Steps to reproduce
Install node version 20.6.0
Install npm version 10.0.0
Run npx create-docusaurus@latest docusaurusnode20test classic --typescript
Expected behavior
Should create a new docusaurus classic site using Typescript.
Actual behavior
Errors:
PS>npx create-docusaurus@latest docusaurusnode20test classic --typescript
Need to install the following packages:
[email protected]
Ok to proceed? (y)
npm WARN deprecated [email protected]: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility
(node:29016) Warning: Accessing non-existent property 'register' of module exports inside circular dependency
(Usenode --trace-warnings ...to show where the warning was created)
[ERROR] TypeError: common.register is not a function
Your environment
- Docusaurus version used: 2.4.1
- Environment name and version (e.g. Chrome 89, Node.js 16.4): Node.js 20.6.0, NPM 10.0.0
- Operating system and version (e.g. Ubuntu 20.04.2 LTS): Windows 11 Pro
Self-service
- I'd be willing to fix this bug myself.
Activity
rogervdf commentedon Sep 6, 2023
Similar issue starting a few hours ago:
I can also confirm that by pinning at 20.5 all is good, it's 20.6 specifically that breaks something
slorber commentedon Sep 7, 2023
Wonder if it's related to #9278, will investigate later
slorber commentedon Sep 7, 2023
Probably related to nodejs/node#49497
Seburan commentedon Sep 8, 2023
we started also to get the same error on september 6th when running "docusaurus build" in our CI/CD pipeline on Cloud Build using the default "node:latest" image.
now reverting to build image "node:lts" until it's fixed.
slorber commentedon Sep 8, 2023
Duplicate of #9291