-
-
Notifications
You must be signed in to change notification settings - Fork 8.8k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Error in Node.js v20.6.0: "TypeError: Cannot set property NODE_MAJOR_VERSION of #<Object> which has only a getter" #9278
Comments
I can't reproduce this locally either... Does it work if you downgrade your Node version in your CI? |
I'm also experiencing this when building with node v20.6.0 . |
We may need to report this to node, but I'm not entirely sure how to phrase it... |
It would help if someone can reproduce this locally. From there, we can try to minimize the reproduction because it obviously involves transpiled CJS code. |
Also affected in ci-pipeline using node:latest image for build. It's a private repo so cannot help with reproducing. |
* Add upcoming section for Sep 2023 release * Document support for connecting to other Hyper processes not spawned by the own program * Update version for upcoming September release * Fix node version to 20.5 due to a bug See issue: facebook/docusaurus#9278 --------- Co-authored-by: Dimitri Vorona <dvorona@tableau.com> Co-authored-by: Adrian Vogelsgesang <avogelsgesang@salesforce.com>
this can be reproduced locally if you install the specific version of node 20.6.0. can use "fnm" or "nvm" or similar to get versions currently 20.6.0 also runs into #9286 so to reproduce, you can use an old version of node to create the docusaurus instance, then the newer version hits the error shell log % fnm use 20.2.0
Using Node v20.2.0
% npx create-docusaurus@latest my-website classic
...stuff...
% cd my-website
% npm i
...stuff...
% npm run build
...still using the v20.2.0, works...
% fnm use 20.6.0
Using Node v20.6.0
% npm run build
> my-website@0.0.0 build
> docusaurus build
/home/cdiesh/my-website/node_modules/@docusaurus/utils/lib/index.js:9
exports.replaceMarkdownLinks = exports.writeMarkdownHeadingId = exports.parseMarkdownString = exports.parseMarkdownContentTitle = exports.parseFrontMatter = exports.createExcerpt = exports.parseMarkdownHeadingId = exports.groupTaggedItems = exports.normalizeFrontMatterTags = exports.buildSshUrl = exports.buildHttpsUrl = exports.hasSSHProtocol = exports.removeTrailingSlash = exports.addTrailingSlash = exports.addLeadingSlash = exports.resolvePathname = exports.isValidPathname = exports.encodePath = exports.fileToPath = exports.getEditUrl = exports.normalizeUrl = exports.findAsyncSequential = exports.mapAsyncSequential = exports.removePrefix = exports.removeSuffix = exports.localizePath = exports.getPluginI18nPath = exports.updateTranslationFileMessages = exports.mergeTranslations = exports.GitNotFoundError = exports.FileNotTrackedError = exports.getFileCommitDate = exports.readOutputHTMLFile = exports.generate = exports.WEBPACK_URL_LOADER_LIMIT = exports.DEFAULT_PLUGIN_ID = exports.DEFAULT_PORT = exports.CODE_TRANSLATIONS_FILE_NAME = exports.DEFAULT_I18N_DIR_NAME = exports.THEME_PATH = exports.OUTPUT_STATIC_ASSETS_DIR_NAME = exports.DEFAULT_STATIC_DIR_NAME = exports.SRC_DIR_NAME = exports.GENERATED_FILES_DIR_NAME = exports.BABEL_CONFIG_FILE_NAME = exports.DEFAULT_CONFIG_FILE_NAME = exports.DEFAULT_BUILD_DIR_NAME = exports.DOCUSAURUS_VERSION = exports.NODE_MINOR_VERSION = exports.NODE_MAJOR_VERSION = void 0;
TypeError: Cannot set property NODE_MAJOR_VERSION of #<Object> which has only a getter
at Object.<anonymous> (/home/cdiesh/my-website/node_modules/@docusaurus/utils/lib/index.js:9:1421)
at Module._compile (node:internal/modules/cjs/loader:1241:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1295:10)
at Module.load (node:internal/modules/cjs/loader:1091:32)
at Module._load (node:internal/modules/cjs/loader:938:12)
at Module.require (node:internal/modules/cjs/loader:1115:19)
at require (node:internal/modules/helpers:130:18)
at Object.<anonymous> (/home/cdiesh/my-website/node_modules/@docusaurus/utils/lib/dataFileUtils.js:15:17)
at Module._compile (node:internal/modules/cjs/loader:1241:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1295:10)
Node.js v20.6.0
|
Probably related to nodejs/node#49497 |
Context: facebook/docusaurus#9278 Signed-off-by: Matej Focko <me@mfocko.xyz>
In case this helps reproducibility:
|
also getting this error with v20.6.:
|
Duplicate of #9291 |
Have you read the Contributing Guidelines on issues?
Prerequisites
npm run clear
oryarn clear
command.rm -rf node_modules yarn.lock package-lock.json
and re-installing packages.Description
Docusaurus builds are failing in CI with:
Reproducible demo
No response
Steps to reproduce
I'm like 99% sure this is caused by Node.js v20.6.0, which came out today, the same time these errors started cropping up: https://github.com/nodejs/node/blob/main/doc/changelogs/CHANGELOG_V20.md#20.6.0
However, this seems to only happen in CI and not locally. https://github.com/moonrepo/moon/actions/runs/6078432962/job/16489581930?pr=1037
Expected behavior
It builds correctly.
Actual behavior
It fails with a non-fixable error.
Your environment
Self-service
The text was updated successfully, but these errors were encountered: