Hi all see info about my issue below. I’d really like to get Ghost from source working locally in debug mode.
- What’s your URL? This is the easiest way for others to debug your issue.
Running locally from VS Code in WSL2 environment on Windows using latest Ubunto distro
http://localhost:2368/ and http://localhost:2368/ghost
- What version of Ghost are you using?
Running latest from source: ghost-admin@5.89.1
- What configuration?
Ghost Core + Admin
- What browser?
Chrome
- What errors or information do you see in the console?
NX Watch connection closed
The daemon has closed the connection to this watch process.
Please restart your watch command.
nx run ghost:dev exited with code SIGTERM
- What steps could someone else take to reproduce the issue you’re having?
-
Install wsl on windows and follow instruction for setting up Linux user
-
Install git on linux distro and configure user info
-
Clone Ghost source code and change orgin to point at my fork as directed on Ghost site: Ghost Docs.
-
So my Ghost project is in /home/repos/Ghost
-
Install nvm using curl:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.0/install.sh | bash
-
use nvm to install node:
nvm install --lts
-
Install nx globally:
npm install -g nx
-
Enable yarn:
corepack enable
-
Add knex-migrator:
yarn global add knex-migrator ember-cli
-
Run ``yarn setup```
-
Run ``yarn fix``` if needed
-
Try to launch VS Code debugger in Ghost core + Admin config
-
Seems to launch the website instances fine. I see the instances with the correct ports up and running, but then it errors out:
-
Note this only seems to happen when attaching the debugger. Running
yarn dev
launches every thing okay. However, I’d like to attach the debugger so I can step through the code and get a deeper understanding of how everything is working together. -
When running with the --verbose flag I see some output like this:
[webpack.cache.PackFileCacheStrategy/webpack.FileSystemInfo] Resolving ‘fs-extra/lib/index’ in /home/joshua/repos/Ghost/node_modules/ember-cli/lib/models for build dependencies doesn’t lead to expected result ‘/home/joshua/repos/Ghost/node_modules/fs-extra/lib/index.js’, but to ‘/home/joshua/repos/Ghost/node_modules/ember-cli/node_modules/fs-extra/lib/index.js’ instead. Resolving dependencies are ignored for this path.
Does any one know what might be happening here and/or how to fix this and/or how to step through the Core code using breakpoints in VS code? I’d really like to learn the Ghost stack. Unfortunately I’m stuck using Windows machines as long as Microsoft is paying my bills. I do a lot of .net api development. I might be able to contribute some to those sort of integrations.
Any help would be appreciated. This is my first go at running a project with javascript as the backend and ember. I saw some similar questions asking about running on Windows, but seems their issue as not using WSL2 on Windows.