Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error running ghost on Windows 10

Tags:

ghost

I installed ghost and ghost-CLI on Windows 10. When I run ghost start I get the error below. how to fix this? It seems related to the command to check file and folder permissions. Note that I'm running ghost in the D: drive.

By the way, if I run ghost run it works.

D:\onlinehelp>ghost start
Process manager 'systemd' will not run on this system, defaulting to 'local'
√ Checking current folder permissions
√ Validating config
× Checking folder permissions
× Checking file permissions
√ Checking memory availability
One or more errors occurred.

1) Checking folder permissions

Message: Command failed: C:\WINDOWS\system32\cmd.exe /q /s /c "find ./ -type d ! -perm 775 ! -perm 755"
FIND: Parameter format not correct


Exit code: 2



2) Checking file permissions

Message: Command failed: C:\WINDOWS\system32\cmd.exe /q /s /c "find ./  -type f ! -path "./versions/*" ! -perm 664 ! -perm 644"
File not found - ./
File not found - -TYPE
File not found - F
File not found - !
File not found - -PATH
File not found - !
File not found - -PERM
File not found - 664
File not found - !
File not found - -PERM
File not found - 644


Exit code: 1


Debug Information:
    OS: Microsoft Windows, v10.0.16299
    Node Version: v8.9.1
    Ghost-CLI Version: 1.7.2
    Environment: production
    Command: 'ghost start'

Additional log info available in: C:\Users\pablo\.ghost\logs\ghost-cli-debug-2018-05-01T16_58_30_857Z.log

Try running ghost doctor to check your system for known issues.

Please refer to https://docs.ghost.org/v1/docs/troubleshooting#section-cli-errors for troubleshooting.

D:\onlinehelp>
like image 443
ps0604 Avatar asked Nov 07 '22 07:11

ps0604


1 Answers

This isn't an ideal solution but it worked for me.

Ghost uses linux's find command to check permissions, this command does not exist on windows (or at least the windows find command does not accept the same arguments.

I was pretty sure my permissions were fine, so I decided to bypass the check.

To do so, locate where ghost-cli is installed globally, in my case it was C:\Users\your-name-here\AppData\Roaming\npm\node_modules\ghost-cli

In there, you want to find lib\commands\doctor\checks\check-permissions.js

you will notice a line that starts with return execa.shell(

This is the line we want to avoid, to do so, we can return a result before it is run, in my case I added the line return Promise.resolve();

e.g.

return Promise.resolve();

return execa.shell(checkTypes[type].command, {maxBuffer: Infinity}).then((result) => {
...
like image 158
Lightweight Avatar answered Dec 01 '22 21:12

Lightweight