在 Windows 10 上运行 ghost 时出错

ps0*_*604 5 ghost

我在 Windows 10 上安装了 ghost 和 ghost-CLI。运行时ghost start出现以下错误。如何解决这个问题?它似乎与检查文件和文件夹权限的命令有关。请注意,我在 D: 驱动器中运行 ghost。

顺便说一句,如果我运行ghost run它就可以了。

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>
Run Code Online (Sandbox Code Playgroud)

Lig*_*ght 1

这不是一个理想的解决方案,但它对我有用。

Ghost使用linux的find命令来检查权限,这个命令在windows上不存在(或者至少windowsfind命令不接受相同的参数。

我很确定我的权限没有问题,所以我决定绕过检查。

为此,请找到 Ghost-cli 的全局安装位置,在我的例子中是 C:\Users\your-name-here\AppData\Roaming\npm\node_modules\ghost-cli

在那里,你想找到lib\commands\doctor\checks\check-permissions.js

你会注意到一行以 return execa.shell(

这是我们想要避免的行,为此,我们可以在运行之前返回结果,在我的例子中,我添加了行return Promise.resolve();

例如

return Promise.resolve();

return execa.shell(checkTypes[type].command, {maxBuffer: Infinity}).then((result) => {
...
Run Code Online (Sandbox Code Playgroud)