Cause and solution of ghost installation error in nodejs, nodejsghost
After reading the title, you will know that there will be a lot of pitfalls when installing ghost. Here we will start with one:
Error
(Windows) installation steps through ghost-cli:
Npm install-g ghost-cli # ghost-clicd myghostblog # enter the working directory ghost install local # use the local parameter to initialize a ghost in the current directory and use the sqlite Database
The error message is as follows:
√ Downloading and installing Ghost v?√ Finishing install process√ Configuring Ghost√ Setting up instance× Running database migrationsA SystemError occurred.
In the ghost install local process, not only the ghost Initialization is completed, but also the installation of the dependent Library (that is, npm install) is completed)
The error message shows that the Running database migrations has an error. The cause is that an error occurs when the dependent package sqlite3 is downloaded.
In fact, an error occurred while downloading the dependent package. Only one warning is given, and the warning will jump over until the migrator step (data migration, that is, initializing the database) has an error, leading to installation failure.
Why did an error occur when downloading sqlite3?
Cause
It is because the sqlite3 package (sqlite3 for node) is on .s3.amazonaws.com, Which is walled. * (Full of tears !)
Knowing the cause is easy to solve.
Solution
Solution: cnpm install sqlite3 # Use taobao image for Installation
The specific process is as follows:
Npm install-g ghost-clicd myghostblog ghost install local # cd currentcnpm install # install the dependency library with the taobao image and install knex-migrator init # initialize the sqlite database, will use MigratorConfig. jsgrunt dev # Run the Dev Environment
Open your browser http: // localhost: 2368/
Enhanced
The above is run using grunt in the current directory. If you want to return to ghost-cli to run through ghost, you still need to do one thing, copy the myghostblog \ current \ content \ data \ ghost-dev.db file to myghostblog \ content \ data \ ghost-dev.db and change the file name to a ghost-local.db. (Check the directory difference. There is a difference between the current directory)
In this way, you can go back to the myghostblog directory and start it with ghost start.
cd myghostblogghost start
Open your browser http: // localhost: 2368/
Finally, let's talk about the environment.
windows 10 Node Version: v6.10.3 Ghost-CLI Version: 1.1.3 Ghost Version: 1.14.02017-10-23
The above is all the content of this article. I hope it will be helpful for your learning and support for helping customers.