You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[bug] npx create-docusaurus failing on node.js 20.6.0 npm 10.0.0 #9286
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:
create-docusaurus@2.4.1
Ok to proceed? (y)
npm WARN deprecated stable@0.1.8: 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
(Use node --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
#17 10.28 [ERROR] TypeError: common.register is not a function
#17 10.30 npm notice
#17 10.30 npm notice New major version of npm available! 9.8.1 -> 10.0.0
#17 10.30 npm notice Changelog: <https://github.com/npm/cli/releases/tag/v10.0.0>
#17 10.30 npm notice Run `npm install -g npm@10.0.0` to update!
#17 10.30 npm notice
#17 ERROR: process "/bin/sh -c npx --yes create-docusaurus@latest template classic" did not complete successfully: exit code: 1
I can also confirm that by pinning at 20.5 all is good, it's 20.6 specifically that breaks something
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.
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