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

"ghost install local" error in windows #228

Closed
biswajit-saha opened this issue Jun 26, 2017 · 19 comments · Fixed by #366
Closed

"ghost install local" error in windows #228

biswajit-saha opened this issue Jun 26, 2017 · 19 comments · Fixed by #366
Assignees
Labels
Milestone

Comments

@biswajit-saha
Copy link

I use ghost locally to develop themes and now I need to install ghost 1.0.0 for updating and testing my old themes. But I can't install and run Ghost 1.0.0-beta.2 ( not tried/tested previous 1.0.0 versions )

Windows 8.1
Node 6.11.0



C:\ghost>ghost install local
 √ Checking for latest Ghost version
 √ Running system checks
 √ Setting up install directory
 √ Downloading and installing Ghost v1.0.0-beta.2
 √ Moving files
√ Finishing setup
 √ Validating config
An error occurred.
Message: 'The server has encountered an error.'


Debug Information:
    Node Version: v6.11.0
    Ghost-CLI Version: 1.0.0-alpha.19
    Environment: development
    Command: 'ghost install local'
(node:768) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: ENOENT: no such file or directory, open 'C:\ghost\ghost-cli-debug-2017-06-26T08:24:49.047Z.log'

C:\ghost>ghost start
Found a development config but not a production config, starting in development mode instead.
 √ Validating config
An error occurred.
Message: 'The server has encountered an error.'


Debug Information:
    Node Version: v6.11.0
    Ghost-CLI Version: 1.0.0-alpha.19
    Environment: development
    Command: 'ghost start'
(node:1332) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: ENOENT: no such file or directory, open 'C:\ghost\ghost-cli-debug-2017-06-26T08:25:07.131Z.log'

Automatically generated config.development.json file

{"url":"http://localhost:2368/","pname":"ghost-local-1-2-3-4-5-6-7-8-9-10-11","server":{"port":2368},"process":"local","database":{"client":"sqlite3","connection":{"filename":"C:\\ghost\\content\\data\\ghost-local.db"}},"logging":{"transports":["file","stdout"]}}

Folder structure after the installation

http://prntscr.com/fo87ro

Is there any more data should I provide?

@kirrg001 kirrg001 added the bug label Jun 26, 2017
@kirrg001 kirrg001 added this to the 1.0.0-rc.1 milestone Jun 26, 2017
@kirrg001
Copy link
Contributor

ENOENT: no such file or directory, open 'C:\ghost\ghost-cli-debug-2017-06-26T08:24:49.047Z.log'

Somehow the ghost cli debug file can't be found. The first step would be to reproduce this bug on windows.

@biswajit-saha
Copy link
Author

Maybe the colon ( : ) in file name preventing to generate or save the file. As far as I know, colon ( : ) is not a valid charecter for file name in Windows.

@kirrg001
Copy link
Contributor

@acburdine
Copy link
Member

That's definitely a problem - good catch!

However, there's likely another error happening here. Ghost-CLI won't try to log to a debug file unless something else goes wrong.

@biswajit-saha would you be able to remove the Date.toIsoString() section from the above mentioned line and try it again? We can get to the root cause of the issue that way 😄

@biswajit-saha
Copy link
Author

@acburdine I will love to do the test. But, I can't find the ghost-CLI folder in my machine. I have searched in global node_module and npm folder but can't find anything. Any clue, where I can find the above mention file in my pc?

@acburdine
Copy link
Member

@biswajit-saha ah sorry that file's only in master - try looking here: https://github.com/TryGhost/Ghost-CLI/blob/1.0.0-alpha.19/lib/ui.js#L201

@biswajit-saha
Copy link
Author

Sorry, I am very nobo at this part. I normally work with HTML, CSS :)
Is there a way to clone the master branch and install the ghost-cli manually? After that I can try to use ghost install and see the error log.

@biswajit-saha
Copy link
Author

Never mind, I have found the required info in readme. I will give it a try at night and let you know the result.

@biswajit-saha
Copy link
Author

@acburdine here is the log file's content

Debug Information:
    Node Version: v6.11.0
    Ghost-CLI Version: 1.0.0-alpha.19
    Environment: development
    Command: 'ghost install local'
An error occurred.
Message: 'The server has encountered an error.'

Stack: InternalServerError: The server has encountered an error.
    at new KnexMigrateError (C:\ghost\Ghost-CLI\node_modules\knex-migrator\lib\errors.js:7:26)
    at new KnexMigrator (C:\ghost\Ghost-CLI\node_modules\knex-migrator\lib\index.js:26:15)
    at Listr.run.then (C:\ghost\Ghost-CLI\lib\commands\start.js:39:28)

Error: Your content path does not exist! Please double check `paths.contentPath` in your custom config file e.g. config.production.json.
    at doesContentPathExist (C:\ghost\testblog\versions\1.0.0-beta.2\core\server\config\utils.js:78:15)
    at Object.loadNconf (C:\ghost\testblog\versions\1.0.0-beta.2\core\server\config\index.js:61:11)
    at Object.<anonymous> (C:\ghost\testblog\versions\1.0.0-beta.2\core\server\config\index.js:78:27)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (C:\ghost\testblog\versions\1.0.0-beta.2\MigratorConfig.js:1:76)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)

acburdine added a commit that referenced this issue Jun 27, 2017
refs #228
- remove potentially invalid path characters from debug log name
acburdine added a commit to acburdine/Ghost that referenced this issue Jun 27, 2017
@acburdine
Copy link
Member

PSA for those in this issue: The bug is actually with Ghost and not with the CLI - so until a new version of Ghost is released this unfortunately can't be fixed on the CLI side.

@kirrg001 kirrg001 assigned kirrg001 and unassigned cobbspur Jun 28, 2017
@rasmuslundberg
Copy link

Anyone have an update on this? I have the same problem, anything i can do to help?

@acburdine
Copy link
Member

acburdine commented Jun 29, 2017

@rasmuslundberg per my above comment - this is a bug in Ghost itself. I put a PR in to fix it (TryGhost/Ghost#8641), but until that's merged / a new version is released there's not much I can do on the CLI side.

@rasmuslundberg
Copy link

@acburdine Thx for your reply, great work with the PR, lets hope the ghost them merges fast. For now im doing a raw npm install in a folder just to get started. Take care.

kirrg001 pushed a commit to TryGhost/Ghost that referenced this issue Jul 5, 2017
@kirrg001
Copy link
Contributor

kirrg001 commented Jul 5, 2017

Should be resolved via https://github.com/TryGhost/Ghost-CLI/blob/1.0.0-beta.4/lib/system.js#L316 and TryGhost/Ghost#8641. Please re-open if you still experience a problem on windows 👍

@kirrg001 kirrg001 closed this as completed Jul 5, 2017
@acburdine
Copy link
Member

PSA: this will only be fixed after a new version of Ghost is released.

@acburdine
Copy link
Member

Reopening this issue because even after the new Ghost release, something still isn't working right.

Would anyone on this issue be willing to download the latest Ghost-CLI version and see if it works? The tests I did in Appveyor weren't passing correctly, but I don't have a windows box so I'm not able to debug at the moment.

@acburdine acburdine reopened this Jul 11, 2017
@kirrg001
Copy link
Contributor

Can do tomorrow 👍

@WaqasIbrahim
Copy link

WaqasIbrahim commented Jul 18, 2017

Hello, I am trying to install ghost on Windows 10 but I get this error message.

λ ghost install local
√ Checking system Node.js version
√ Checking current folder permissions
i Checking operating system [skipped]
i Checking MySQL is installed [skipped]
√ Checking for latest Ghost version
√ Setting up install directory
√ Downloading and installing Ghost v1.0.0-rc.1
√ Finishing install process
√ Configuring Ghost
√ Setting up instance
√ Running database migrations
√ Validating config
× Starting Ghost
An error occurred.
Message: 'spawn ghost ENOENT'


Debug Information:
    Node Version: v6.11.0
    Ghost-CLI Version: 1.0.0-rc.2
    Environment: development
    Command: 'ghost install local'

Contents of log file are:

Debug Information:
    Node Version: v6.11.0
    Ghost-CLI Version: 1.0.0-rc.2
    Environment: development
    Command: 'ghost install local'
An error occurred.
Message: 'spawn ghost ENOENT'

Stack: Error: spawn ghost ENOENT
    at exports._errnoException (util.js:1018:11)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:193:32)
    at onErrorNT (internal/child_process.js:367:16)
    at _combinedTickCallback (internal/process/next_tick.js:80:11)
    at process._tickCallback (internal/process/next_tick.js:104:9)
Code: ENOENT
Path: ghost

Any solution? Thanks

Update: This issue was resolved, thanks to @acburdine.

@acburdine
Copy link
Member

PSA: as of ghost-cli 1.0.0-rc.3, ghost install local works on Windows.

HOWEVER, there is one small gotcha. There will be another shell window opened that is marked simply as a node process. Don't close that second window as that's the actual running Ghost blog. Unfortunately there's not an easy way around this, so it has to be there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants