Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to install and run Ghost from Source on Windows 11 #17704

Open
1 task done
shaunroselt opened this issue Aug 13, 2023 · 9 comments
Open
1 task done

Unable to install and run Ghost from Source on Windows 11 #17704

shaunroselt opened this issue Aug 13, 2023 · 9 comments
Labels
bug [triage] something behaving unexpectedly

Comments

@shaunroselt
Copy link
Contributor

Issue Summary

I am trying to install and run Ghost from Source, but I'm having issue after issue. It's just not working for me. I tried following this tutorial, but that's not working either.

I've tried using Windows Terminal (PowerShell), Visual Studio Code Terminal, and Git Bash. With Git Bash, I am able to make the best progression.

This is my exact Windows 11 Version and Build:
Windows 11 Version and Build

Steps to Reproduce

In the most simple steps (not following the above tutorial). Here they are:

  1. Fork the repo: https://github.com/shaunroselt/Ghost
  2. Install Git
  3. Install NodeJS 18.17.1 LTS
    NodeJS and NPM Version
  4. Install yarn
    Install yarn
  5. Clone Ghost locally. I have mine cloned here:
    Ghost.org locally on Windows
  6. I then open my Ghost root folder from Git Bash
    Ghost opened on Windows
  7. run yarn global add knex-migrator ember-cli
    run yarn global add knex-migrator ember-cli
  8. run yarn
    run yarn
    This completes without any errors. Just a bunch of warnings and info:
    run yarn complete
  9. run yarn setup
    run yarn setup
  10. run yarn dev
    run yarn dev
    run yarn dev info
    And then here is where the errors start:
    ERROR Unable to activate the theme "casper". and Unable to activate the theme "casper".:
    ERROR Unable to activate the theme "casper". and Unable to activate the theme "casper".
    Notice also this error, Error: ENOENT: no such file or directory, copyfile 'C:\Shaun Roselt Development\Ghost\Ghost\ghost\core\core\frontend\src\admin-auth\index.html' -> 'C:\Shaun Roselt Development\Ghost\Ghost\ghost\core\content\public\admin-auth\index.html', but the weird thing here is that that file that it says no such file or directory, I can clearly see that it does exist and it is there:
    Ghost admin-auth
  11. I then try to run yarn fix as that is what the console recommends at the bottom, but it doesn't fix the issue. After yarn fix is done, then I do yarn setup and yarn dev again, but it's still the same. The exact same errors with the Casper theme are there:

  1. Something else I tried was to separately download the Casper theme and put it into Ghost/ghost/core/content/themes/casper:
    Casper Theme for Ghost on Windows
  2. I then tried the same steps again, but it got stuck with repeating Restarting 'Index.js' for 15min+ when I ran yarn dev:
     Restarting 'Index.js'
  3. I then left to go get food and came back an hour later and instead of repeating ``Restarting 'Index.js'`, it was now repeating something else the whole time:
    Unable to activate the theme 'casper'

So in conclution. This didn't work either.

Ghost Version

5.59.0

Node.js Version

18.17.1 LTS

How did you install Ghost?

From https://ghost.org/docs/install/source/ on Windows 11

Database type

MySQL 5.7

Browser & OS version

No response

Relevant log / error output

No response

Code of Conduct

  • I agree to be friendly and polite to people in this repository
@github-actions github-actions bot added the needs:triage [triage] this needs to be triaged by the Ghost team label Aug 13, 2023
@shaunroselt
Copy link
Contributor Author

Ghost install logs.txt

Here are my Git Bash install logs also for one of the attempts

@shaunroselt
Copy link
Contributor Author

Okay. So I managed to fix the first issue of ERROR Unable to activate the theme "casper". and Unable to activate the theme "casper". when running yarn dev.

I haven't sorted the second issue yet. Still looking at what's causing it and where it's happening.

Just as a quick reminder. This is the second issue:
TypeError [ERR_INVALID_ARG_TYPE]: The "paths[1]" argument must be of type string. Received null

TypeError [ERR_INVALID_ARG_TYPE]: The "paths[1]" argument must be of type string. Received null

@shaunroselt
Copy link
Contributor Author

Some extra info. Installing Ghost locally using this tutorial works perfectly fine, but installing from Source doesn't work.

@daniellockyer daniellockyer added the bug [triage] something behaving unexpectedly label Sep 4, 2023
@github-actions github-actions bot removed the needs:triage [triage] this needs to be triaged by the Ghost team label Sep 4, 2023
@markstos
Copy link
Contributor

markstos commented Sep 7, 2023

If doesn't break anything on your system, could you try renaming your C: drive folder to not have spaces? If that fixes it, then Ghost has a bug about handling paths with spaces in them.

@ogunleye0720
Copy link

Hello, I see you have a directory named with spaces on your C drive (C:\Shaun Roselt Development). The paths function is not able to recognize paths with spaces in between the name. Hence the reason for the Type error.
You should rename the path by adding an hyphen "-" in between the words.

C:\Shaun-Roselt-Development\Ghost\Ghost\ghost\core

@shaunroselt
Copy link
Contributor Author

Hello, I see you have a directory named with spaces on your C drive (C:\Shaun Roselt Development). The paths function is not able to recognize paths with spaces in between the name. Hence the reason for the Type error. You should rename the path by adding an hyphen "-" in between the words.

C:\Shaun-Roselt-Development\Ghost\Ghost\ghost\core

Hi.

Did you test this on your side? Is the spaces definitely the issue?

@ASAMedia
Copy link

Hi,
same problem here (Win 11).
I have it running on a path without spaces and here it also errors with paths[1] not a string

PS D:\Github\Ghost-LFG> yarn dev
yarn run v1.22.19
$ node .github/scripts/dev.js
$ vite build --watch
[adminX] vite v4.5.0 building for production...
[adminX]
[adminX] watching for file changes...
[adminX]
[adminX] build started...
[adminX] transforming...
[ghost]
[ghost]  >  NX   Running target dev for project ghost and 10 tasks it depends on:
[ghost]
[ghost]
[admin]
[admin] > nx run ghost-admin:dev --live-reload-base-url=/ghost/ --live-reload-port=4201
[admin]
[admin] > ghost-admin@5.71.0 dev
[admin] > ember serve --live-reload-base-url=/ghost/ --live-reload-port=4201
[ghost]
[ghost] > nx run @tryghost/post-events:"build:ts"
[ghost]
$ yarn build
$ tsc
[ghost]
[ghost] > nx run @tryghost/nql-filter-expansions:"build:ts"
[ghost]
$ yarn build
$ tsc
[ghost]
[ghost] > nx run @tryghost/in-memory-repository:"build:ts"
[ghost]
$ yarn build
$ tsc
[ghost]
[ghost] > nx run @tryghost/donations:"build:ts"
[ghost]
$ yarn build
$ tsc
[ghost]
[ghost] > nx run @tryghost/bookshelf-repository:"build:ts"
[ghost]
$ yarn build
$ tsc
[ghost]
[ghost] > nx run @tryghost/collections:"build:ts"
[ghost]
$ yarn build
$ tsc
[ghost]
[ghost] > nx run @tryghost/post-revisions:"build:ts"
[ghost]
$ yarn build
$ tsc
[ghost]
> nx run @tryghost/mail-events:"build:ts"
[ghost]
$ yarn build
$ tsc
[ghost]
[ghost] > nx run @tryghost/recommendations:"build:ts"
[ghost]
$ yarn build
$ tsc
[ghost]
[ghost] > nx run @tryghost/model-to-domain-event-interceptor:"build:ts"
[ghost]
$ yarn build
$ tsc
[ghost]
[ghost] > nx run ghost:dev
[ghost]
[adminX] ✓ 2172 modules transformed.
warning ghost@5.71.0: The engine "cli" appears to be invalid.
$ node --watch index.js
[adminX] rendering chunks...
[ghost] (node:26100) ExperimentalWarning: Watch mode is an experimental feature and might change at any time
[ghost] (Use `node --trace-warnings ...` to show where the warning was created)
[ghost] [2023-10-30 17:04:10] INFO Ghost is running in development...
[ghost] [2023-10-30 17:04:10] INFO Listening on: 127.0.0.1:2368
[ghost] [2023-10-30 17:04:10] INFO Url configured as: http://localhost:2368/
[ghost] [2023-10-30 17:04:10] INFO Ctrl+C to shut down
[ghost] [2023-10-30 17:04:10] INFO Ghost server started in 0.806s
[admin] WARNING: Node v18.18.2 is not tested against Ember CLI on your platform. We recommend that you use the most-recent "Active LTS" version of Node.js. See https://git.io/v7S5n for details.
[ghost] Restarting 'index.js'
[ghost] [2023-10-30 17:04:11] INFO Ghost is running in development...
[ghost] [2023-10-30 17:04:11] INFO Listening on: 127.0.0.1:2368
[ghost] [2023-10-30 17:04:11] INFO Url configured as: http://localhost:2368/
[ghost] [2023-10-30 17:04:11] INFO Ctrl+C to shut down
[ghost] [2023-10-30 17:04:11] INFO Ghost server started in 0.764s
[adminX] computing gzip size...
[adminX] dist/CodeEditorView-2238ab27.mjs     84.63 kB │ gzip:  23.97 kB │ map:   288.00 kB
[adminX] dist/admin-x-settings.js            101.99 kB │ gzip:  14.63 kB │ map:     0.10 kB
[adminX] dist/index-2ea35dba.mjs             184.89 kB │ gzip:  63.39 kB │ map:   347.12 kB
[adminX] dist/index-af2c647a.mjs             421.03 kB │ gzip:  73.37 kB │ map: 1,229.09 kB
[adminX] dist/index-d60e4d45.mjs             489.98 kB │ gzip: 138.14 kB │ map: 1,393.61 kB
[adminX] dist/index-1d6009ff.mjs             938.70 kB │ gzip: 338.92 kB │ map: 2,175.90 kB
[adminX] dist/modals-72f7b349.mjs          1,411.88 kB │ gzip: 626.55 kB │ map: 3,678.25 kB
[adminX] built in 13844ms.
[ghost] [2023-10-30 17:04:11] INFO Database is in a ready state.
[ghost] [2023-10-30 17:04:11] INFO Ghost database ready in 1.094s
[ghost] [2023-10-30 17:04:12] ERROR The currently active theme "source" is missing.
[ghost]
[ghost] The currently active theme "source" is missing.
[ghost] "name: source"
[ghost] "path: D:\\Github\\Ghost-LFG\\ghost\\core\\content\\themes\\"
[ghost] Error ID:
[ghost]     5958ec40-7746-11ee-b15f-3d762c2eb7cb
[ghost] Error Code:
[ghost]     ENOENT
[ghost]
[ghost] [2023-10-30 17:04:13] INFO Adding offloaded job to the queue
[ghost] [2023-10-30 17:04:13] INFO Scheduling job mentions-email-report at 32 14 * * * *. Next run on: Mon Oct 30 2023 18:14:32 GMT+0100 (Mitteleuropäische Normalzeit)
[ghost] [2023-10-30 17:04:13] INFO Adding offloaded job to the queue
[ghost] [2023-10-30 17:04:13] INFO Scheduling job clean-expired-comped at 14 52 1 * * *. Next run on: Tue Oct 31 2023 01:52:14 GMT+0100 (Mitteleuropäische Normalzeit)
[ghost] [2023-10-30 17:04:13] INFO Adding offloaded job to the queue
[ghost] [2023-10-30 17:04:13] INFO Scheduling job clean-tokens at 14 8 6 * * *. Next run on: Tue Oct 31 2023 06:08:14 GMT+0100 (Mitteleuropäische Normalzeit)
[ghost] [2023-10-30 17:04:13] INFO Ghost booted in 3.147s
[ghost] [2023-10-30 17:04:13] INFO Adding offloaded job to the queue
[ghost] [2023-10-30 17:04:13] INFO Scheduling job update-check at 27 34 2 * * *. Next run on: Tue Oct 31 2023 02:34:27 GMT+0100 (Mitteleuropäische Normalzeit)
[ghost] [2023-10-30 17:04:13] INFO Running milestone emails job on Mon Oct 30 2023 18:04:18 GMT+0100 (Mitteleuropäische Normalzeit)
[ghost] [2023-10-30 17:04:14] INFO Ghost URL Service Ready in 3.719s
[ghost] node:internal/validators:162
[ghost]     throw new ERR_INVALID_ARG_TYPE(name, 'string', value);
[ghost]     ^
[ghost] TypeError [ERR_INVALID_ARG_TYPE]: The "paths[1]" argument must be of type string. Received null
[ghost]     at new NodeError (node:internal/errors:405:5)
[ghost]     at validateString (node:internal/validators:162:11)
[ghost]     at resolve (node:path:167:9)
[ghost]     at FSWatcher.<anonymous> (node:internal/watch_mode/files_watcher:99:30)
[ghost]     at FSWatcher.emit (node:events:517:28)
[ghost]     at FSWatcher._handle.onchange (node:internal/fs/watchers:215:12) {
[ghost]   code: 'ERR_INVALID_ARG_TYPE'
[ghost] }
[ghost] Node.js v18.18.2
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
[ghost]
[ghost]
[ghost]
[ghost]  >  NX   Running target dev for project ghost and 10 tasks it depends on failed
[ghost]
[ghost]    Failed tasks:
[ghost]
[ghost]    - ghost:dev
[ghost]
[ghost]    Hint: run the command with --verbose for more details.
[ghost]
[ghost] nx run ghost:dev exited with code 1
--> Sending SIGTERM to other processes..
[ts] nx watch --projects=ghost/collections,ghost/in-memory-repository,ghost/bookshelf-repository,ghost/mail-events,ghost/model-to-domain-event-interceptor,ghost/post-revisions,ghost/nql-filter-expansions,ghost/post-events,ghost/donations,ghost/recommendations -- nx run \$NX_PROJECT_NAME:build:ts exited with code 1
--> Sending SIGTERM to other processes..
[adminX] yarn dev exited with code 1
--> Sending SIGTERM to other processes..
[admin] nx run ghost-admin:dev --live-reload-base-url=/ghost/ --live-reload-port=4201 exited with code 1

Executing dev command failed, ensure dependencies are up-to-date by running `yarn fix`

Done in 19.01s.

@ASAMedia
Copy link

ASAMedia commented Oct 30, 2023

The funny thing is
yarn dev:ghost
and
yarn dev:admin
run like a charm on their own😅.

I will change to a ubuntu system just to check.
BUT what the hell is going on here.

Copy link
Contributor

Our bot has automatically marked this issue as stale because there has not been any activity here in some time.

The issue will be closed soon if there are no further updates, however we ask that you do not post comments to keep the issue open if you are not actively working on a PR.

We keep the issue list minimal so we can keep focus on the most pressing issues. Closed issues can always be reopened if a new contributor is found. Thank you for understanding 🙂

@github-actions github-actions bot added stale [triage] Issues that were closed to to lack of traction and removed stale [triage] Issues that were closed to to lack of traction labels Feb 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug [triage] something behaving unexpectedly
Projects
None yet
Development

No branches or pull requests

5 participants