nodejs / nodejs.org

The Node.js® Website
https://nodejs.org
MIT License
6.1k stars 6.2k forks source link

[ERROR] Can't run site locally #7010

Closed milen-prg closed 1 week ago

milen-prg commented 2 weeks ago

URL:

https://github.com/nodejs/nodejs.org.git

Browser Name:

Firefox

Browser Version:

129.0.2

Operating System:

Windows 11 Pro 64bit

How to reproduce the issue:

❯ git clone --recursive https://github.com/nodejs/nodejs.org.git Cloning into 'nodejs.org'... remote: Enumerating objects: 54148, done. remote: Counting objects: 100% (253/253), done. remote: Compressing objects: 100% (187/187), done. remote: Total 54148 (delta 93), reused 186 (delta 44), pack-reused 53895 (from 1) Receiving objects: 100% (54148/54148), 102.52 MiB | 7.38 MiB/s, done. Resolving deltas: 100% (37395/37395), done.

❯ cd nodejs.org\

░▒▓ 📁 D:\Documentation\NodeJS\nodejs.org on  main ▓▒░ npm ci ░▒▓ at съб 14:41 🕒 ▓▒░ npm warn EBADENGINE Unsupported engine { npm warn EBADENGINE package: undefined, npm warn EBADENGINE required: { node: 'v20' }, npm warn EBADENGINE current: { node: 'v22.7.0', npm: '10.8.3' } npm warn EBADENGINE } npm warn EBADENGINE Unsupported engine { npm warn EBADENGINE package: undefined, npm warn EBADENGINE required: { node: 'v20' }, npm warn EBADENGINE current: { node: 'v22.7.0', npm: '10.8.3' } npm warn EBADENGINE } npm warn EBADENGINE Unsupported engine { npm warn EBADENGINE package: undefined, npm warn EBADENGINE required: { node: 'v20' }, npm warn EBADENGINE current: { node: 'v22.7.0', npm: '10.8.3' } npm warn EBADENGINE } npm warn deprecated inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful. npm warn deprecated @humanwhocodes/config-array@0.11.14: Use @eslint/config-array instead npm warn deprecated rimraf@2.6.3: Rimraf versions prior to v4 are no longer supported npm warn deprecated rimraf@3.0.2: Rimraf versions prior to v4 are no longer supported npm warn deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported npm warn deprecated abab@2.0.6: Use your platform's native atob() and btoa() methods instead npm warn deprecated @humanwhocodes/object-schema@2.0.3: Use @eslint/object-schema instead npm warn deprecated domexception@4.0.0: Use your platform's native DOMException instead

prepare husky

added 2143 packages, and audited 2145 packages in 47s

510 packages are looking for funding run npm fund for details

1 moderate severity vulnerability

To address all issues, run: npm audit fix

Run npm audit for details.

❯ npx turbo dev turbo 2.0.11

WARNING stale pid file at "C:\Users\User\AppData\Local\Temp\turbod\22edb148bf76988c\turbod.pid" • Packages in scope: @nodejs/website • Running dev in 1 packages • Remote caching disabled @nodejs/website:dev: cache bypass, force executing 61f5cdc828fa7283 @nodejs/website:dev: @nodejs/website:dev: > dev @nodejs/website:dev: > cross-env NODE_NO_WARNINGS=1 next dev --turbo @nodejs/website:dev: @nodejs/website:dev: file:///D:/Documentation/NodeJS/nodejs.org/apps/site/next.json.mjs:3 @nodejs/website:dev: import _authors from './authors.json' assert { type: 'json' }; @nodejs/website:dev: ^^^^^^ @nodejs/website:dev: @nodejs/website:dev: SyntaxError: Unexpected identifier 'assert' @nodejs/website:dev: at compileSourceTextModule (node:internal/modules/esm/utils:337:16) @nodejs/website:dev: at ModuleLoader.moduleStrategy (node:internal/modules/esm/translators:166:18) @nodejs/website:dev: at callTranslator (node:internal/modules/esm/loader:436:14) @nodejs/website:dev: at ModuleLoader.moduleProvider (node:internal/modules/esm/loader:442:30) @nodejs/website:dev: @nodejs/website:dev: Node.js v22.7.0 @nodejs/website:dev: npm error Lifecycle script dev failed with error: @nodejs/website:dev: npm error code 1 @nodejs/website:dev: npm error path D:\Documentation\NodeJS\nodejs.org\apps\site @nodejs/website:dev: npm error workspace @nodejs/website @nodejs/website:dev: npm error location D:\Documentation\NodeJS\nodejs.org\apps\site @nodejs/website:dev: npm error command failed @nodejs/website:dev: npm error command C:\Windows\system32\cmd.exe /d /s /c cross-env NODE_NO_WARNINGS=1 next dev --turbo @nodejs/website:dev: ERROR: command finished with error: command (D:\Documentation\NodeJS\nodejs.org\apps\site) C:\Program Files\nodejs\npm.cmd run dev exited (1) @nodejs/website#dev: command (D:\Documentation\NodeJS\nodejs.org\apps\site) C:\Program Files\nodejs\npm.cmd run dev exited (1)

Tasks: 0 successful, 1 total Cached: 0 cached, 1 total Time: 871ms Failed: @nodejs/website#dev

ERROR run failed: command exited (1)

░▒▓ 📁 D:\Documentation\NodeJS\nodejs.org on  main ▓▒░

AugustinMauroy commented 2 weeks ago

As NPM points out, you're using the wrong version of node to run the project, so there's a difference in how to import JSON with node, which makes for a breaking change.

aduh95 commented 1 week ago

there's a difference in how to import JSON with node

Not exactly, Node.js 20.x does still support the old assert syntax to avoid a breaking change, but it also supports the new with syntax, as Node.js 22.x. We should update to the new syntax.