# Database migration error

**URL:** <https://forum.ghost.org/t/database-migration-error/1270>\
**Category:** Installation\
**Tags:** ghost-cli\
**Created:** [May 16, 2018, 3:36pm UTC](https://forum.ghost.org/t/database-migration-error/1270 "2018-05-16T15:36:50Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![meakaakka](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/meakaakka/32/603_2.png) [@meakaakka](https://forum.ghost.org/u/meakaakka)\
**Post date:** [May 16, 2018, 3:36pm UTC](https://forum.ghost.org/t/database-migration-error/1270/1 "2018-05-16T15:36:50Z")

</div>

### Technical details:

- Ghost Version: 1.22.8
- Ghost-cli: 1.7.3
- npm: 5.6.0
- python: 2.7.12
- Node Version: 8.9.4
- Browser/OS: Ubuntu 16.04 EC2 AWS

I’m trying to setup a blog on my ec2 instance using [this](https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-ghost-on-ubuntu-16-04) tutorial.

Error logs -

> ****
>
> ✔ Setting up Systemd Running sudo command: /var/www/ghost/current/node\_modules/.bin/knex-migrator-migrate --init --mgpath /var/www/ghost/current ✖ Running database migrations A ProcessError occurred.
> 
> Message: The database migration in Ghost encountered an error.  
> Help: [Page Not Found](https://docs.ghost.org/v1/docs/troubleshooting#section-general-update-error)
> 
> Debug Information:  
> OS: Ubuntu, v16.04  
> Node Version: v8.9.4  
> Ghost-CLI Version: 1.7.3  
> Environment: production  
> Command: ‘ghost install’
> 
> Additional log info available in: /home/user/.ghost/logs/ghost-cli-debug-2018-05-15T20\_26\_18\_686Z.log

I have tried removing, reinstalling everything (node, python, ghost, mysql etc) nothing seems to work 😞  
(everything works as expected if I use the docker method)

---

<div class="post-metadata">

**Author:** ![Kevin](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/kevin/32/32_2.png) [@Kevin](https://forum.ghost.org/u/Kevin)\
**Post date:** [May 16, 2018, 3:38pm UTC](https://forum.ghost.org/t/database-migration-error/1270/2 "2018-05-16T15:38:14Z")

</div>

> [@meakaakka](#):
>
> Additional log info available in: /home/user/.ghost/logs/ghost-cli-debug-2018-05-15T20\_26\_18\_686Z.log

@meakaakka is there any other information in that log file?

---

<div class="post-metadata">

**Author:** ![meakaakka](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/meakaakka/32/603_2.png) [@meakaakka](https://forum.ghost.org/u/meakaakka)\
**Post date:** [May 16, 2018, 7:15pm UTC](https://forum.ghost.org/t/database-migration-error/1270/3 "2018-05-16T19:15:22Z")

</div>

> [@Kevin](#):
>
> /home/user/.ghost/logs/ghost-cli-debug-2018-05-15T20\_26\_18\_686Z.log

@Kevin Here is the output -

```auto
▶ cat /home/user/.ghost/logs/ghost-cli-debug-2018-05-15T20_26_18_686Z.log
Debug Information:
    OS: Ubuntu, v16.04
    Node Version: v8.9.4
    Ghost-CLI Version: 1.7.3
    Environment: production
    Command: 'ghost install'
Message: The database migration in Ghost encountered an error.
Help: https://docs.ghost.org/v1/docs/troubleshooting#section-general-update-error
--------------- stderr ---------------
/usr/bin/env: ‘node’: No such file or directory

```

---

<div class="post-metadata">

**Author:** ![vikaspotluri123](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/vikaspotluri123/32/24_2.png) [@vikaspotluri123](https://forum.ghost.org/u/vikaspotluri123)\
**Post date:** [May 16, 2018, 7:17pm UTC](https://forum.ghost.org/t/database-migration-error/1270/4 "2018-05-16T19:17:30Z")

</div>

> [@meakaakka](#):
>
> ```auto
> /usr/bin/env: ‘node’: No such file or directory
> 
> ```

The location of the node binary isn’t in your path - Can you check and make sure node is installed system-wide and not just for you?

---

<div class="post-metadata">

**Author:** ![meakaakka](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/meakaakka/32/603_2.png) [@meakaakka](https://forum.ghost.org/u/meakaakka)\
**Post date:** [May 16, 2018, 7:35pm UTC](https://forum.ghost.org/t/database-migration-error/1270/5 "2018-05-16T19:35:04Z")

</div>

@vikaspotluri123 I have installed node using the nvm. Output of `node -v` is `v8.9.4`.

---

<div class="post-metadata">

**Author:** ![vikaspotluri123](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/vikaspotluri123/32/24_2.png) [@vikaspotluri123](https://forum.ghost.org/u/vikaspotluri123)\
**Post date:** [May 16, 2018, 7:35pm UTC](https://forum.ghost.org/t/database-migration-error/1270/6 "2018-05-16T19:35:34Z")

</div>

What is the output of `sudo -u ghost node -v`?

---

<div class="post-metadata">

**Author:** ![meakaakka](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/meakaakka/32/603_2.png) [@meakaakka](https://forum.ghost.org/u/meakaakka)\
**Post date:** [May 16, 2018, 7:36pm UTC](https://forum.ghost.org/t/database-migration-error/1270/7 "2018-05-16T19:36:33Z")

</div>

> [@vikaspotluri123](#):
>
> sudo -u ghost node -v

It’s - `sudo: node: command not found`

---

<div class="post-metadata">

**Author:** ![vikaspotluri123](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/vikaspotluri123/32/24_2.png) [@vikaspotluri123](https://forum.ghost.org/u/vikaspotluri123)\
**Post date:** [May 16, 2018, 7:38pm UTC](https://forum.ghost.org/t/database-migration-error/1270/8 "2018-05-16T19:38:08Z")

</div>

This means nvm / node is installed only for your user and not system-wide. In some cases in order to install ghost, node must be installed system-wide.

---

<div class="post-metadata">

**Author:** ![meakaakka](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/meakaakka/32/603_2.png) [@meakaakka](https://forum.ghost.org/u/meakaakka)\
**Post date:** [May 16, 2018, 7:50pm UTC](https://forum.ghost.org/t/database-migration-error/1270/9 "2018-05-16T19:50:54Z")

</div>

> [@meakaakka](#):
>
> sudo -u ghost node -v

Okay, it seems like nvm only install the node for per user so I have uninstalled it and install using the standard way. This is what I see now -  
`sudo -u ghost node -v`  
`v6.14.2`

---

<div class="post-metadata">

**Author:** ![vikaspotluri123](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/vikaspotluri123/32/24_2.png) [@vikaspotluri123](https://forum.ghost.org/u/vikaspotluri123)\
**Post date:** [May 16, 2018, 7:55pm UTC](https://forum.ghost.org/t/database-migration-error/1270/10 "2018-05-16T19:55:39Z")

</div>

You should be able to install Ghost now! 🎉

---

<div class="post-metadata">

**Author:** ![meakaakka](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/meakaakka/32/603_2.png) [@meakaakka](https://forum.ghost.org/u/meakaakka)\
**Post date:** [May 16, 2018, 7:57pm UTC](https://forum.ghost.org/t/database-migration-error/1270/11 "2018-05-16T19:57:31Z")

</div>

Hurry, it worked. So I think the problem was in the nvm. It would be great if this is mentioned somewhere in the docs so that other users don’t face similar issue. Thanks a lot ❤

---

<div class="post-metadata">

**Author:** ![Aileen](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/aileen/32/9846_2.png) [@Aileen](https://forum.ghost.org/u/Aileen)\
**Post date:** [May 17, 2018, 1:09am UTC](https://forum.ghost.org/t/database-migration-error/1270/12 "2018-05-17T01:09:06Z")

</div>

> [@meakaakka](#):
>
> It would be great if this is mentioned somewhere in the docs so that other users don’t face similar issue.

There is a big box in the docs, explaining that `nvm` can be problematic and that you should install node systemwide:

[https://docs.ghost.org/docs/install#section-finally-install-node-js](https://docs.ghost.org/docs/install#section-finally-install-node-js)

Hope, that helps?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex015/uploads/ghost2/original/2X/b/ba9ce5100b8bb264586f4f572545596b2ce3f081.png) [@system](https://forum.ghost.org/u/system)\
**Post date:** [May 31, 2018, 1:09am UTC](https://forum.ghost.org/t/database-migration-error/1270/13 "2018-05-31T01:09:07Z")

</div>

Closed on May 31, 2018, 1:09am UTC

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
