event-catalog / eventcatalog

An open source documentation tool to bring discoverability to your event-driven architectures
https://eventcatalog.dev
MIT License
1.64k stars 135 forks source link

yarn build on windows give a lot of ERR and not spitting out the static pages under /out folder #504

Closed wliew99 closed 1 month ago

wliew99 commented 4 months ago

Have you read the Contributing Guidelines on issues?

Description

Unable to yarn build on windows to get the staic pages generated under /out folder. Running the same codebase in macOS and github action with ubuntu works.

Steps to reproduce

rm -rf node_modules rm .eventcatalog-core yarn -> works

yarn build gives the following a lot of errors and did not spit out the /out folder for static pages

and if you run yarn build again, you will get this

@eventcatalog/core@1.2.5 scripts:move-schema-for-download node scripts/move-schemas-for-download.js

@eventcatalog/core@1.2.5 build next build && next export

node:internal/modules/cjs/loader:1080 throw err; ^

Error: Cannot find module 'C:\Users\myname\next\dist\bin\next' at Module._resolveFilename (node:internal/modules/cjs/loader:1077:15) at Module._load (node:internal/modules/cjs/loader:922:27) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:86:12) at node:internal/main/run_main_module:23:47 { code: 'MODULE_NOT_FOUND', requireStack: [] }

Expected behavior

yarn install yarn build should generate /out folder under root then we can deploy locally on windows to publish static pages

Actual behavior

yarn build gives this error very long ... [4/4] Building fresh packages... [8/10] ⠂ tree-sitter-json [-/10] ⠄ waiting... [10/10] ⠄ tree-sitter-yaml [4/10] ⠄ esbuild warning Error running install script for optional dependency: "C:\Users\myname\eventcatalog\node_modules\tree-sitter-yaml: Command failed. Exit code: 1 Command: node-gyp rebuild Arguments: Directory: C:\Users\myname\eventcatalog\node_modules\tree-sitter-yaml Output: gyp info it worked if it ends with ok gyp info using node-gyp@10.1.0 gyp info using node@18.18.0 | win32 | x64 gyp info find Python using Python version 3.12.2 found at \"C:\Users\myname\AppData\Local\Programs\Python\Python312\python.exe\"

gyp ERR! find VS gyp ERR! find VS msvs_version not set from command line or npm config gyp ERR! find VS VCINSTALLDIR not set, not running in VS Command Prompt gyp ERR! find VS could not use PowerShell to find Visual Studio 2017 or newer, try re-running with '--loglevel silly' for more details. gyp ERR! find VS gyp ERR! find VS Failure details: undefined gyp ERR! find VS could not use PowerShell to find Visual Studio 2017 or newer, try re-running with '--loglevel silly' for more details. gyp ERR! find VS gyp ERR! find VS Failure details: undefined ... yp ERR! stack Error: Could not find any Visual Studio installation to use gyp ERR! stack at VisualStudioFinder.fail (C:\Users\myname\AppData\Local\Yarn\Data\global\node_modules\node-gyp\lib\find-visualstudio.js:116:11) gyp ERR! stack at VisualStudioFinder.findVisualStudio (C:\Users\myname\AppData\Local\Yarn\Data\global\node_modules\node-gyp\lib\find-visualstudio.js:72:17) gyp ERR! stack at process.processTicksAndRejections (node:internal/process/task_queues:95:5) gyp ERR! stack at async createBuildDir (C:\Users\myname\AppData\Local\Yarn\Data\global\node_modules\node-gyp\lib\configure.js:95:26) gyp ERR! stack at async run (C:\Users\myname\AppData\Local\Yarn\Data\global\node_modules\node-gyp\bin\node-gyp.js:81:18) gyp ERR! System Windows_NT 10.0.19045 gyp ERR! command \"C:\\Program Files\\nodejs\\node.exe\" \"C:\\Users\\myname\\AppData\\Local\\Yarn\\Data\\global\\node_modules\\node-gyp\\bin\\node-gyp.js\" \"rebuild\" gyp ERR! cwd C:\Users\myname\eventcatalog\node_modules\tree-sitter Done in 168.79s.

Your environment

Using @eventcatalog/core": "1.2.5" $ node -v => v18.18.0 $ yarn -v => 1.22.22 Using bash shell on windows 10 Pro (19045.4170) inside VSC v1.88.0

boyney123 commented 1 month ago

Thanks for raising this issue.


EventCatalog v2 is coming out very soon, so going to close this as I believe it’s no longer an issue in the new version.


If you still experience this issue please raise a new issue.


Thank you!