TryGhost / Ghost

Independent technology for modern publishing, memberships, subscriptions and newsletters.
https://ghost.org
MIT License
47.36k stars 10.34k forks source link

Ghost fails to install on clean Ubuntu 13.10 x64 Server #1787

Closed mjbshaw closed 10 years ago

mjbshaw commented 10 years ago

I've created a new droplet on Digital Ocean for testing, and I ran the following commands (starting from a fresh Ubuntu install):

# apt-get update
# apt-get upgrade
# apt-get install sqlite3
# apt-get install nodejs
# apt-get install nodejs-legacy
# apt-get install npm
# apt-get install ruby
# gem install bundler
# apt-get install git
# git clone https://github.com/TryGhost/Ghost.git
# cd Ghost/
# git submodule update --init
# bundle install
# npm install -g grunt-cli
# npm install

npm install fails with:

npm http GET https://registry.npmjs.org/sqlite3/2.1.19
npm http GET https://registry.npmjs.org/grunt-update-submodules
npm http 304 https://registry.npmjs.org/sqlite3/2.1.19
npm http 304 https://registry.npmjs.org/grunt-update-submodules
npm http GET https://registry.npmjs.org/grunt
npm http 304 https://registry.npmjs.org/grunt
npm ERR! Error: No compatible version found: grunt@'~0.4.0rc3'
npm ERR! Valid install targets:
npm ERR! ["0.1.0","0.1.1","0.1.2","0.2.0","0.2.1","0.2.2","0.2.3","0.2.4","0.2.5","0.2.6","0.2.7","0.2.8","0.2.9","0.2.10","0.2.11","0.2.12","0.2.13","0.2.14","0.2.15","0.3.0","0.3.1","0.3.2","0.3.3","0.3.4","0.3.5","0.3.6","0.3.7","0.3.8","0.3.9","0.3.10","0.3.11","0.3.12","0.3.13","0.3.14","0.3.15","0.3.16","0.3.17","0.4.0","0.4.1","0.4.2","0.3.13-a","0.4.0-a","0.4.0-rc1","0.4.0-rc2","0.4.0-rc3","0.4.0-rc4","0.4.0-rc5","0.4.0-rc6","0.4.0-rc7","0.4.0-rc8"]
npm ERR!     at installTargetsError (/usr/share/npm/lib/cache.js:685:10)
npm ERR!     at /usr/share/npm/lib/cache.js:607:10
npm ERR!     at saved (/usr/share/npm/node_modules/npm-registry-client/lib/get.js:138:7)
npm ERR!     at /usr/lib/nodejs/graceful-fs/polyfills.js:133:7
npm ERR!     at Object.oncomplete (fs.js:107:15)
npm ERR! If you need help, you may report this log at:
npm ERR!     <http://bugs.debian.org/npm>
npm ERR! or use
npm ERR!     reportbug --attach /root/Ghost/npm-debug.log npm

npm ERR! System Linux 3.11.0-12-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install"
npm ERR! cwd /root/Ghost
npm ERR! node -v v0.10.15
npm ERR! npm -v 1.2.18

...

npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /root/Ghost/npm-debug.log
npm ERR! not ok code 0

Strangely I do not have these issues on OS X. It seems to be wanting grunt@'~0.4.0rc3', but what my system has is grunt@0.4.2:

# npm ls | grep grunt
├─┬ grunt@0.4.2
├─┬ grunt-contrib-clean@0.5.0
├─┬ grunt-contrib-compress@0.5.3
├── grunt-contrib-concat@0.3.0
├── grunt-contrib-copy@0.4.1
├─┬ grunt-contrib-handlebars@0.6.0
│ ├─┬ grunt-lib-contrib@0.5.3
├─┬ grunt-contrib-sass@0.5.1
├─┬ grunt-contrib-uglify@0.2.7
│ ├─┬ grunt-lib-contrib@0.6.1
├─┬ grunt-contrib-watch@0.5.3
├── grunt-express-server@0.4.11
├─┬ grunt-groc@0.4.0
├── grunt-jslint@1.1.2
├── grunt-mocha-cli@1.4.0
├─┬ grunt-shell@0.6.1
# npm -g ls | grep grunt
└─┬ grunt-cli@0.1.11

I can provide more info, or even a fresh Digital Ocean droplet for testing (all I need is a public SSH key to give someone access). I'm not quite sure what's requiring grunt@'~0.4.0rc3'... I'm still looking.

ErisDS commented 10 years ago

Whilst obviously something is up - my first thought is, why are you installing master from source on DO?! It's totally unstable :dancers:

Can you gist up the /root/Ghost/npm-debug.log?

I've just done a fresh install on my windows machine with no problems so I'm thinking this is definitely environmental, not something wrong with the dependencies.

Next up apt-get install nodejs has always installed node 0.6 - we've had so many people do that and then wonder why Ghost doesn't work, but it seems you managed to get 0.10.15. So has the package been updated? I'm also not sure what apt-get install nodejs-legacy does.. or why node and npm have to be installed separately. All of the install guides for linux suggest using Chris Lea's PPA which will give you the latest stable version of node - 0.10.15 is less out of date than 0.6 but still out of date.

halfdan commented 10 years ago

The list has 0.4.0-rc3 (note the dash) while the package.json lists ~0.4.0rc3. Can you check whether that would fix the issue?

ErisDS commented 10 years ago

Which package.json has this?

Ours has "grunt": "~0.4.1",

halfdan commented 10 years ago

@ErisDS, oh - to be honest I didn't look at the package.json, I just took it from the error message. Ours should be fine indeed.

halfdan commented 10 years ago

Seems to be grunt-update-submodules: https://github.com/jaubourg/grunt-update-submodules/blob/master/package.json

ErisDS commented 10 years ago

That may be wrong - looks like the package isn't really maintained anymore though.

I hate to pull the IWFM card, but why is this only failing for @mjbshaw on such a specific env? I would say it's because node and npm are out of date, perhaps the version of npm in buggy?

mjbshaw commented 10 years ago

Whilst obviously something is up - my first thought is, why are you installing master from source on DO?! It's totally unstable

What's life without a little Russian roulette? :grinning:

Can you gist up the /root/Ghost/npm-debug.log?

Yeah, the gist is here: npm-debug.log

I would say it's because node and npm are out of date, perhaps the version of npm in buggy?

I just built and installed node and npm from source, and it worked fine with no errors. So I would agree that node v0.10.15 + npm v1.2.18 is problematic, which is unfortunately the default of Ubuntu's repos.

If people don't want to build from source, Chris Lea maintains up-to-date node (and npm) packages here (with SO Q&A here).

Maybe the Ghost requirements should say npm 1.3.x? (I actually have no idea if 1.3.0 works; but 1.3.21 with node 0.10.24 is working).

ErisDS commented 10 years ago

See if we can get the grunt-update-submodule module updated, but I'm not even 100% it's actually working :/

ErisDS commented 10 years ago

Have pushed an update to the grunt-update-submodule package which should fix this.

@mjbshaw are you able to confirm?

mjbshaw commented 10 years ago

Fix confirmed! Ghost installed perfectly on Ubuntu 13.10 x64 Server using Ubuntu's default repos and node and npm versions.

Closing as fixed by e53148e.

ErisDS commented 10 years ago

Excellent news - this means that anyone using Saucy or Trusy can install Ghost the sensible way using default packages, rather than having to use the PPA.

PPA is probably still preferable though, as it means you can always get the latest.