Skip to content
This repository has been archived by the owner on Nov 26, 2018. It is now read-only.

Errors during vagrant up #36

Closed
rucka opened this issue Jan 26, 2014 · 24 comments · Fixed by #42
Closed

Errors during vagrant up #36

rucka opened this issue Jan 26, 2014 · 24 comments · Fixed by #42
Labels

Comments

@rucka
Copy link

rucka commented Jan 26, 2014

Hi All,
I installed virtual box (4.2.2), vagrant and ghost-vagrant as read me documentation on my ; also i upgraded virtual box guest addition.
After vagrant up command 'git submodule update' error occur (my logs following):

Bringing machine 'default' up with 'virtualbox' provider...
[default] Setting the name of the VM...
[default] Clearing any previously set forwarded ports...
[default] Creating shared folders metadata...
[default] Clearing any previously set network interfaces...
[default] Preparing network interfaces based on configuration...
[default] Forwarding ports...
[default] -- 22 => 2222 (adapter 1)
[default] Running any VM customizations...
[default] Booting VM...
[default] Waiting for VM to boot. This can take a few minutes.
[default] VM booted and ready for use!
GuestAdditions 4.2.22 running --- OK.
[default] Configuring and enabling network interfaces...
[default] Mounting shared folders...
[default] -- /vagrant
[default] -- /tmp/vagrant-puppet/manifests
[default] -- /tmp/vagrant-puppet/modules-0
[default] Exporting NFS shared folders...
Preparing to edit /etc/exports. Administrator privileges will be required...
Password:
[default] Mounting NFS shared folders...
[default] Running provisioner: puppet...
Running Puppet with base.pp...
warning: Could not retrieve fact fqdn
err: /Stage[main]/Ghost/Exec[git submodule update]/returns: change from notrun to 0 failed: git submodule update --init returned 128 instead of one of [0] at /tmp/vagrant-puppet/modules-0/ghost/manifests/init.pp:62
notice: /Stage[main]/Nvm/Exec[set-node-version]/returns: executed successfully
err: /Stage[main]/Ghost/Exec[npm-install-packages]/returns: change from notrun to 0 failed: npm install returned 34 instead of one of [0] at /tmp/vagrant-puppet/modules-0/ghost/manifests/init.pp:56
notice: /Stage[main]/Ghost/Exec[grunt init]: Dependency Exec[npm-install-packages] has failures: true
warning: /Stage[main]/Ghost/Exec[grunt init]: Skipping because of failed dependencies
notice: /Stage[main]/Upstart/Service[app]/ensure: ensure changed 'stopped' to 'running'
notice: Finished catalog run in 1.36 seconds
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

cd /tmp/vagrant-puppet/manifests && puppet apply --modulepath '/etc/puppet/modules:/tmp/vagrant-puppet/modules-0' base.pp --detailed-exitcodes || [ $? -eq 2 ]

Can you help me?
Thanks
Regards
Gianluca

@jgable
Copy link
Contributor

jgable commented Jan 27, 2014

Can you try to vagrant halt && vagrant up once and see if that resolves it?

Otherwise, once the machine goes up and has the error, you can still ssh in via vagrant ssh then go to the code directory and run npm install for yourself to see the error message.

@rucka
Copy link
Author

rucka commented Jan 27, 2014

Thank for your reply jgable. Log provided belong to vagrant halt and vagrant up :(
After login and npm install, error is:

npm ERR! install Couldn't read dependencies
npm ERR! Error: ENOENT, open '/home/vagrant/code/Ghost/package.json'
npm ERR! If you need help, you may report this log at:
npm ERR! http://github.com/isaacs/npm/issues
npm ERR! or email it to:
npm ERR! npm-@googlegroups.com

npm ERR! System Linux 3.2.0-58-generic
npm ERR! command "/home/vagrant/nvm/v0.10.5/bin/node" "/home/vagrant/nvm/v0.10.5/bin/npm" "install"
npm ERR! cwd /home/vagrant/code/Ghost
npm ERR! node -v v0.10.5
npm ERR! npm -v 1.2.18
npm ERR! path /home/vagrant/code/Ghost/package.json
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/vagrant/code/Ghost/npm-debug.log
npm ERR! not ok code 0

In Ghost folder there are only npm log files: seems clone ghost repository fails but I don't know why...
Thanks for your support
Regards
Gianluca

@lourinaldi
Copy link

For what it's worth, I'm experiencing identical errors on two different physical machines.

@halfdan
Copy link
Contributor

halfdan commented Feb 20, 2014

@rucka, @lourinaldi This sounds like Ghost is not properly mounted into the virtual machine. Please make sure that you have cloned the Ghost repository alongside Ghost-Vagrant. Your directory structure should look like the following:

./
./Ghost/
./Ghost-Vagrant/

Please also make sure that NFS works properly on your machines.

@halfdan halfdan added the bug label Feb 20, 2014
@lourinaldi
Copy link

@halfdan you were right, I had unpacked https://ghost.org/zip/ghost-0.4.1.zip rather than cloning the repo. Fixed that. But I still get "grunt init" errors during provisioning.

@halfdan
Copy link
Contributor

halfdan commented Feb 21, 2014

@lourinaldi Can you post the errors here?

@lourinaldi
Copy link

@halfdan I wiped everything and re-cloned the two repos fresh. On running vagrant up, I get the following (only pasting relevant section). Then going to http://local.tryghost.org/ yields "502 Bad Gateway" from nginx.

warning: Could not retrieve fact fqdn
notice: /Stage[main]//File[/etc/motd]/ensure: defined content as '{md5}a6d3f317085844c5d931e94c0b0fd21c'
notice: /Stage[main]/Ghost/File[/home/vagrant/code]/owner: owner changed 'root' to 'vagrant'
notice: /Stage[main]/Ghost/File[/home/vagrant/code]/group: group changed 'root' to 'vagrant'
notice: /Stage[main]/Essentials/File[/home/vagrant/software]/ensure: created
notice: /Stage[main]/Essentials/Package[libssl-dev]/ensure: ensure changed 'purged' to 'present'
notice: /Stage[main]/Essentials/Package[git-core]/ensure: ensure changed 'purged' to 'present'
notice: /Stage[main]/Essentials/Package[bourbon]/ensure: created
notice: /Stage[main]/Casperjs/File[phantomjs-src]/ensure: defined content as '{md5}a6a7d2cb38dd4305240cdc48e0d5a30f'
notice: /Stage[main]/Nvm/Exec[source-nvm]/returns: executed successfully
notice: /Stage[main]/Ghost/Exec[git submodule update]/returns: executed successfully
notice: /Stage[main]/Nvm/Exec[clone-nvm]/returns: executed successfully
notice: /Stage[main]/Nvm/Exec[install-node]/returns: executed successfully
notice: /Stage[main]/Nvm/Exec[set-node-version]/returns: executed successfully
notice: /Stage[main]/Ghost/Ghost::Npm[grunt-cli]/Exec[install-grunt-cli-npm-package]/returns: executed successfully
notice: /Stage[main]/Ghost/Ghost::Npm[sass]/Exec[install-sass-npm-package]/returns: executed successfully
err: /Stage[main]/Ghost/Exec[npm-install-packages]/returns: change from notrun to 0 failed: npm install returned 50 instead of one of [0] at /tmp/vagrant-puppet-1/modules-0/ghost/manifests/init.pp:56
notice: /Stage[main]/Ghost/Exec[grunt init]: Dependency Exec[npm-install-packages] has failures: true
warning: /Stage[main]/Ghost/Exec[grunt init]: Skipping because of failed dependencies
notice: /Stage[main]/Ghost/Ghost::Npm[mocha]/Exec[install-mocha-npm-package]/returns: executed successfully
notice: /Stage[main]/Upstart/File[app-conf]/ensure: defined content as '{md5}8fcd59cc6d2051ded65c9fdc68de658d'
notice: /Stage[main]/Nginx/Package[nginx]/ensure: ensure changed 'purged' to 'present'
notice: /Stage[main]/Nginx/File[nginx-conf]/ensure: defined content as '{md5}34f921860cafbd3190ecc993ff0928dd'
notice: /Stage[main]/Nginx/Service[nginx]/ensure: ensure changed 'stopped' to 'running'
notice: /Stage[main]/Nginx/Service[nginx]: Triggered 'refresh' from 1 events
notice: /Stage[main]/Upstart/Service[app]/ensure: ensure changed 'stopped' to 'running'
notice: /Stage[main]/Casperjs/Exec[extract-phantomjs]/returns: executed successfully
notice: /Stage[main]/Casperjs/Exec[link-phantomjs]/returns: executed successfully
notice: /Stage[main]/Casperjs/Exec[git-casperjs]/returns: executed successfully
notice: /Stage[main]/Casperjs/Exec[link-casperjs]/returns: executed successfully
notice: Finished catalog run in 58.51 seconds

@halfdan
Copy link
Contributor

halfdan commented Feb 22, 2014

Those are mostly notices. You receive the 502 Bad Gateway because you didn't start Ghost. You need to vagrant ssh into the virtual machine and then cd code/Ghost/. Then run npm install -g grunt-cli && npm install and finally start Ghost with npm start.


@lourinaldi Can you try and update the guest additions? (https://github.com/TryGhost/Ghost-Vagrant#updating-virtual-box-guest-additions). Do a vagrant destroy to delete the previous image.

@kamilkowalski
Copy link

Hi there, I just tried setting up the Vagrant box and got a similar error:

...
err: /Stage[main]/Ghost/Ghost::Npm[grunt-cli]/Exec[install-grunt-cli-npm-package]/returns: change from notrun to 0 failed: npm install -g grunt-cli returned 1 instead of one of [0] at /tmp/vagrant-puppet-1/modules-0/ghost/manifests/init.pp:46
...

So it failed at installing grunt-cli (probably just because it's the first package listed). I logged into the box and went to ~/code/Ghost and tried running npm install -g grunt-cli, what I got was:

vagrant@vagrant-ubuntu-precise-64:~/code/Ghost$ npm install -g grunt-cli
npm http GET https://registry.npmjs.org/grunt-cli
npm http GET https://registry.npmjs.org/grunt-cli
npm http 200 https://registry.npmjs.org/grunt-cli
npm http GET https://registry.npmjs.org/grunt-cli/-/grunt-cli-0.1.13.tgz
npm ERR! fetch failed https://registry.npmjs.org/grunt-cli/-/grunt-cli-0.1.13.tgz
npm http GET https://registry.npmjs.org/grunt-cli/-/grunt-cli-0.1.13.tgz
npm http 200 https://registry.npmjs.org/grunt-cli/-/grunt-cli-0.1.13.tgz
npm ERR! Error: EACCES, mkdir '/home/vagrant/nvm/v0.10.5/lib/node_modules/grunt-cli'
...

So I checked out the path where it tries to install the modules:

vagrant@vagrant-ubuntu-precise-64:~/code/Ghost$ ls -la ~/nvm/v0.10.5/lib
total 16
drwxr-xr-x 4 24561 admin 4096 May 13  2013 .
drwxr-xr-x 5 root  root  4096 Feb 27 23:36 ..
drwxr-xr-x 2 24561 admin 4096 May 13  2013 dtrace
drwxr-xr-x 5 24561 admin 4096 Feb 27 23:39 node_modules

The directory is owned by some admin user and we run npm install as vagrant. I think we could do a chown -R vagrant:vagrant ~/nvm after nvm is installed so the user can install the node packages himself.

I have no clue why it fails upon provisioning though - that should be run as root, right?

@jgable
Copy link
Contributor

jgable commented Feb 28, 2014

@kamilkowalski what version of vagrant and virtual box are you working with?

@lourinaldi
Copy link

@halfdan I finally got it to work after reading @kamilkowalski's comment. And that was only after disabling the new MySQL provisioning in the puppet init file, which was also failing.

@halfdan
Copy link
Contributor

halfdan commented Feb 28, 2014

@lourinaldi Oh - did you get any errors from the MySQL provisioning? I just added MySQL recently and tried to test it as best as I could.

@kamilkowalski
Copy link

@jgable Just tested at work on VirtualBox 4.3.4 and Vagrant 1.4.3 - same error. Back home I have VirtualBox 4.3.6 and Vagrant 1.4.2 I believe. I noticed in README.md that there's no '>=' next to Vagrant's version - does that mean that it has to be exactly the 1.2.2 version?

Anyway, when I logged in to the box here at work and tried running npm install -g grunt-cli, I first got an error I got only once yesterday:

...
npm ERR! fetch failed https://registry.npmjs.org/grunt-cli/-/grunt-cli-0.1.13.tgz
npm ERR! Error: SELF_SIGNED_CERT_IN_CHAIN
...

So I switched to a http:// registry, and then I got the same as yesterday. Running sudo chown -R vagrant:vagrant ~/nvm allowed me to install grunt-cli.

Regardless of the error, I think the nvm directory and its subdirectories should be owned by vagrant since it resides in /home/vagrant - Ghost is run by the vagrant user as well. I don't know how to change the permissions in Puppet manifests though, I don't know that much about it.

@chevcast
Copy link

@kamilkowalski Just so you know, yesterday my builds on Travis-CI were failing also due to SELF_SIGNED_CERT_IN_CHAIN errors. I believe the issue was caused by NPM if I had to guess. My builds are all passing today and I changed nothing.

@jgable
Copy link
Contributor

jgable commented Feb 28, 2014

This looks like a couple of things, the permissions issues, and our old version of NPM was having the SELF_SIGNED_CERT_IN_CHAIN issues after the perms issues were resolved.

Have a fix inbound 🚀

@kamilkowalski
Copy link

@jgable good news! 👍 I was having SSL issues previously not only with npm but also with Ruby Gems. In those cases I usually changed the repository address to HTTP since I thought it's a connectivity problem, good to know it's just a bug.

@halfdan
Copy link
Contributor

halfdan commented Mar 1, 2014

Just to add a source regarding the SSL issues: http://blog.npmjs.org/post/78085451721/npms-self-signed-certificate-is-no-more

@davidblurton
Copy link

I have had a horrible time trying to use this. When puppet fails at the mysql step you are left in a horrible half installed state. How about using a pre-built image instead of using puppet to install dependencies?

@halfdan
Copy link
Contributor

halfdan commented Mar 9, 2014

@davidblurton It would be a lot more helpful if you posted actual error messages here. vagrant up works fine for me and this was confirmed by a few other people that were able to set up the vagrant machine by following the guideline.

Using a pre-built image wouldn't work, as we will also add PostgreSQL.

@davidblurton
Copy link

Sorry, was getting stress out by it earlier. Here is the complete log for a fresh clone:

Bringing machine 'default' up with 'virtualbox' provider...
[default] Importing base box 'base'...

Progress: 90%
[default] Matching MAC address for NAT networking...
[default] Setting the name of the VM...
[default] Clearing any previously set forwarded ports...
[default] Fixed port collision for 22 => 2222. Now on port 2200.
[default] Clearing any previously set network interfaces...
[default] Preparing network interfaces based on configuration...
[default] Forwarding ports...
[default] -- 22 => 2200 (adapter 1)
[default] Running 'pre-boot' VM customizations...
[default] Booting VM...
[default] Waiting for machine to boot. This may take a few minutes...
[default] Machine booted and ready!
[default] The guest additions on this VM do not match the installed version of
VirtualBox! In most cases this is fine, but in rare cases it can
prevent things such as shared folders from working properly. If you see
shared folder errors, please make sure the guest additions within the
virtual machine match the version of VirtualBox you have installed on
your host and reload your VM.

Guest Additions Version: 4.1.12
VirtualBox Version: 4.3
[default] Configuring and enabling network interfaces...
[default] Exporting NFS shared folders...
Preparing to edit /etc/exports. Administrator privileges will be required...
[default] Mounting NFS shared folders...
[default] Mounting shared folders...
[default] -- /vagrant
[default] -- /tmp/vagrant-puppet-1/manifests
[default] -- /tmp/vagrant-puppet-1/modules-0
[default] Running provisioner: puppet...
Running Puppet with base.pp...
warning: Could not retrieve fact fqdn
Puppet::Parser::AST::Resource failed with error ArgumentError: Could not find declared class ::mysql::server at /tmp/vagrant-puppet-1/modules-0/ghost/manifests/mysql.pp:4 on node vagrant-ubuntu-precise-64

@halfdan
Copy link
Contributor

halfdan commented Mar 9, 2014

Did you run git submodule init and git submodule update —recursive?

-- 
Fabian Becker

On 9 Mar 2014 at 18:24:51, David Blurton (notifications@github.com) wrote:

Sorry, was getting stress out by it earlier. Here is the complete log for a fresh clone:

Bringing machine 'default' up with 'virtualbox' provider...
[default] Importing base box 'base'...

Progress: 90%
[default] Matching MAC address for NAT networking...
[default] Setting the name of the VM...
[default] Clearing any previously set forwarded ports...
[default] Fixed port collision for 22 => 2222. Now on port 2200.
[default] Clearing any previously set network interfaces...
[default] Preparing network interfaces based on configuration...
[default] Forwarding ports...
[default] -- 22 => 2200 (adapter 1)
[default] Running 'pre-boot' VM customizations...
[default] Booting VM...
[default] Waiting for machine to boot. This may take a few minutes...
[default] Machine booted and ready!
[default] The guest additions on this VM do not match the installed version of
VirtualBox! In most cases this is fine, but in rare cases it can
prevent things such as shared folders from working properly. If you see
shared folder errors, please make sure the guest additions within the
virtual machine match the version of VirtualBox you have installed on
your host and reload your VM.

Guest Additions Version: 4.1.12
VirtualBox Version: 4.3
[default] Configuring and enabling network interfaces...
[default] Exporting NFS shared folders...
Preparing to edit /etc/exports. Administrator privileges will be required...
[default] Mounting NFS shared folders...
[default] Mounting shared folders...
[default] -- /vagrant
[default] -- /tmp/vagrant-puppet-1/manifests
[default] -- /tmp/vagrant-puppet-1/modules-0
[default] Running provisioner: puppet...
Running Puppet with base.pp...
warning: Could not retrieve fact fqdn
Puppet::Parser::AST::Resource failed with error ArgumentError: Could not find declared class ::mysql::server at /tmp/vagrant-puppet-1/modules-0/ghost/manifests/mysql.pp:4 on node vagrant-ubuntu-precise-64


Reply to this email directly or view it on GitHub.

@davidblurton
Copy link

Aha - that solves the mysql problem - thanks.

Then I follow the instructions in your bad gateway comment above and get the following errors:

vagrant@vagrant-ubuntu-precise-64:~/code/Ghost$ npm install -g grunt-cli && npm install
npm http GET https://registry.npmjs.org/grunt-cli
npm http 200 https://registry.npmjs.org/grunt-cli
npm http GET https://registry.npmjs.org/grunt-cli/-/grunt-cli-0.1.13.tgz
npm http 200 https://registry.npmjs.org/grunt-cli/-/grunt-cli-0.1.13.tgz
npm http GET https://registry.npmjs.org/nopt
npm http GET https://registry.npmjs.org/resolve
npm http GET https://registry.npmjs.org/findup-sync
npm http 200 https://registry.npmjs.org/findup-sync
npm http GET https://registry.npmjs.org/findup-sync/-/findup-sync-0.1.2.tgz
npm http 200 https://registry.npmjs.org/nopt
npm http GET https://registry.npmjs.org/nopt/-/nopt-1.0.10.tgz
npm http 200 https://registry.npmjs.org/resolve
npm http GET https://registry.npmjs.org/resolve/-/resolve-0.3.1.tgz
npm http 200 https://registry.npmjs.org/findup-sync/-/findup-sync-0.1.2.tgz
npm http 200 https://registry.npmjs.org/nopt/-/nopt-1.0.10.tgz
npm http 200 https://registry.npmjs.org/resolve/-/resolve-0.3.1.tgz
npm http GET https://registry.npmjs.org/abbrev
npm http GET https://registry.npmjs.org/glob
npm http GET https://registry.npmjs.org/lodash
npm http 200 https://registry.npmjs.org/abbrev
npm http GET https://registry.npmjs.org/abbrev/-/abbrev-1.0.4.tgz
npm http 200 https://registry.npmjs.org/glob
npm http 200 https://registry.npmjs.org/lodash
npm http GET https://registry.npmjs.org/glob/-/glob-3.1.21.tgz
npm http GET https://registry.npmjs.org/lodash/-/lodash-1.0.1.tgz
npm http 200 https://registry.npmjs.org/abbrev/-/abbrev-1.0.4.tgz
npm http 200 https://registry.npmjs.org/lodash/-/lodash-1.0.1.tgz
npm http 200 https://registry.npmjs.org/glob/-/glob-3.1.21.tgz
npm http GET https://registry.npmjs.org/minimatch
npm http GET https://registry.npmjs.org/graceful-fs
npm http GET https://registry.npmjs.org/inherits
npm http 200 https://registry.npmjs.org/graceful-fs
npm http GET https://registry.npmjs.org/graceful-fs/-/graceful-fs-1.2.3.tgz
npm http 200 https://registry.npmjs.org/inherits
npm http GET https://registry.npmjs.org/inherits/-/inherits-1.0.0.tgz
npm http 200 https://registry.npmjs.org/minimatch
npm http GET https://registry.npmjs.org/minimatch/-/minimatch-0.2.14.tgz
npm http 200 https://registry.npmjs.org/graceful-fs/-/graceful-fs-1.2.3.tgz
npm http 200 https://registry.npmjs.org/inherits/-/inherits-1.0.0.tgz
npm http 200 https://registry.npmjs.org/minimatch/-/minimatch-0.2.14.tgz
npm http GET https://registry.npmjs.org/lru-cache
npm http GET https://registry.npmjs.org/sigmund
npm http 200 https://registry.npmjs.org/sigmund
npm http GET https://registry.npmjs.org/sigmund/-/sigmund-1.0.0.tgz
npm http 200 https://registry.npmjs.org/lru-cache
npm http GET https://registry.npmjs.org/lru-cache/-/lru-cache-2.5.0.tgz
npm http 200 https://registry.npmjs.org/sigmund/-/sigmund-1.0.0.tgz
npm http 200 https://registry.npmjs.org/lru-cache/-/lru-cache-2.5.0.tgz
/home/vagrant/nvm/v0.10.26/bin/grunt -> /home/vagrant/nvm/v0.10.26/lib/node_modules/grunt-cli/bin/grunt
grunt-cli@0.1.13 /home/vagrant/nvm/v0.10.26/lib/node_modules/grunt-cli
├── resolve@0.3.1
├── nopt@1.0.10 (abbrev@1.0.4)
└── findup-sync@0.1.2 (lodash@1.0.1, glob@3.1.21)
npm WARN package.json bcryptjs@0.7.10 No README data
npm WARN package.json blanket@1.1.6 No README data
npm WARN package.json bookshelf@0.6.1 No README data
npm WARN package.json bower@1.2.8 No README data
npm WARN package.json busboy@0.0.12 No README data
npm WARN package.json colors@0.6.2 No README data
npm WARN package.json connect-slashes@1.2.0 No README data
npm WARN package.json downsize@0.0.5 No README data
npm WARN package.json express@3.4.6 No README data
npm WARN package.json express-hbs@0.7.9 No README data
npm WARN package.json fs-extra@0.8.1 No README data
npm WARN package.json grunt@0.4.3 No README data
npm WARN package.json grunt-cli@0.1.13 No README data
npm WARN package.json grunt-contrib-clean@0.5.0 No README data
npm WARN package.json grunt-contrib-compress@0.5.3 No README data
npm WARN package.json grunt-contrib-concat@0.3.0 No README data
npm WARN package.json grunt-contrib-copy@0.4.1 No README data
npm WARN package.json grunt-contrib-handlebars@0.6.1 No README data
npm WARN package.json grunt-contrib-jshint@0.8.0 No README data
npm WARN package.json grunt-contrib-sass@0.5.1 No README data
npm WARN package.json grunt-contrib-uglify@0.2.7 No README data
npm WARN package.json grunt-contrib-watch@0.5.3 No README data
npm WARN package.json grunt-express-server@0.4.13 No README data
npm WARN package.json grunt-groc@0.4.5 No README data
npm WARN package.json grunt-mocha-cli@1.4.0 No README data
npm WARN package.json grunt-shell@0.6.4 No README data
npm WARN package.json grunt-update-submodules@0.2.1 No README data
npm WARN package.json knex@0.5.0 No README data
npm WARN package.json lodash@2.4.1 No README data
npm WARN package.json matchdep@0.3.0 No README data
npm WARN package.json mocha@1.15.1 No README data
npm WARN package.json moment@2.4.0 No README data
npm WARN package.json mysql@2.0.0-alpha9 No README data
npm WARN package.json node-polyglot@0.3.0 No README data
npm WARN package.json node-uuid@1.4.1 No README data
npm WARN package.json nodemailer@0.5.13 No README data
npm WARN package.json request@2.29.0 No README data
npm WARN package.json require-dir@0.1.0 No README data
npm WARN package.json rewire@2.0.0 No README data
npm WARN package.json rss@0.2.1 No README data
npm WARN package.json semver@2.2.1 No README data
npm WARN package.json should@2.1.1 No README data
npm WARN package.json showdown@0.3.1 No description
npm WARN package.json showdown@0.3.1 No README data
npm WARN package.json sinon@1.7.3 No README data
npm WARN package.json sqlite3@2.2.0 No README data
npm WARN package.json supertest@0.8.3 No README data
npm WARN package.json unidecode@0.1.3 No README data
npm WARN package.json validator@3.4.0 No README data
npm WARN package.json when@2.7.0 No README data
vagrant@vagrant-ubuntu-precise-64:~/code/Ghost$ npm start

> ghost@0.4.1 start /home/vagrant/code/Ghost
> node index


module.js:340
    throw err;
          ^
Error: Cannot find module 'when'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (/home/vagrant/code/Ghost/core/bootstrap.js:9:15)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)

npm ERR! ghost@0.4.1 start: `node index`
npm ERR! Exit status 8
npm ERR!
npm ERR! Failed at the ghost@0.4.1 start script.
npm ERR! This is most likely a problem with the ghost package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node index
npm ERR! You can get their info via:
npm ERR!     npm owner ls ghost
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 3.2.0-59-generic
npm ERR! command "/home/vagrant/nvm/v0.10.26/bin/node" "/home/vagrant/nvm/v0.10.26/bin/npm" "start"
npm ERR! cwd /home/vagrant/code/Ghost
npm ERR! node -v v0.10.26
npm ERR! npm -v 1.4.3
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     /home/vagrant/code/Ghost/npm-debug.log
npm ERR! not ok code 0

@davidblurton
Copy link

Ok, figured out the problem. Looks like I've been hitting this npm bug because I'd already installed some of the dependencies in my source folder.

I also had to build sqlite3 from source because it had been built on my mac by grunt init which meant the binary didn't work inside vagrant. I guess I should've run grunt init inside vagrant instead.

The solution was to delete the node_modules directory and then npm install and grunt init from vagrant.

@jbinto
Copy link

jbinto commented Nov 2, 2014

@davidblurton Thanks, removing node_modules is what did it. I spent a while banging my head against the wall, down the same path as you and others in this thread (502 bad gateway, grunt init complaining about "Unable to find local grunt.", etc.)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
8 participants