Ghost on shared web hosting with Node.js


#1

Hello,

Before everything, I’m a web designer and not a programmer, so I’m not very handy with installing stuff like that on a server.

I currently have this web hosting solution that I use for hosting many websites.
My blog uses Grav but I’d like to switch to Ghost without having to pay for a VPS or something like that. My web hosting has Node.js installed, so I thought it might be possible to install Ghost on it but I’m stuck.

What I’ve done so far:

  • Create a production Node.js app (version 8.14.1) on the cPanel
  • SSH into my web hosting and running source /home/<user>/nodevenv/test/8/bin/activate to enter the virtual environment
  • Download Ghost (I’ve tried with the latest version and also version 0.11.12) and unzip it
  • Rename index.js to app.js and change this in package.json

…and I don’t really know what else to do after that, because if I just run npm install, I’m having lots of errors in the command line.

For example, with version 0.11.12 (with Node.js version 6.15.1), this is what I get when I try to run npm install:

npm WARN deprecated nodemailer@0.7.1: All versions below 4.0.1 of Nodemailer are deprecated. See https://nodemailer.com/status/
npm WARN deprecated nomnom@1.5.2: Package no longer supported. Contact support@npmjs.com for more info.
npm WARN deprecated mailcomposer@0.2.12: This project is unmaintained
npm WARN deprecated mimelib@0.2.19: This project is unmaintained

> ghost@0.11.12 preinstall /home/iampoxco/nodevenv/test/6/lib
> node core/server/utils/npm/preinstall.js

module.js:478
    throw err;
    ^

Error: Cannot find module '/home/iampoxco/nodevenv/test/6/lib/core/server/utils/npm/preinstall.js'
    at Function.Module._resolveFilename (module.js:476:15)
    at Function.Module._load (module.js:424:25)
    at Module.runMain (module.js:611:10)
    at run (bootstrap_node.js:394:7)
    at startup (bootstrap_node.js:160:9)
    at bootstrap_node.js:507:3

npm ERR! Linux 3.10.0-962.3.2.lve1.5.24.7.el7.x86_64
npm ERR! argv "/opt/alt/alt-nodejs6/root/usr/bin/node" "/opt/alt/alt-nodejs6/root/usr/bin/npm" "install" "--prefix=/home/iampoxco/nodevenv/test/6/lib"
npm ERR! node v6.15.1
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! ghost@0.11.12 preinstall: `node core/server/utils/npm/preinstall.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ghost@0.11.12 preinstall script 'node core/server/utils/npm/preinstall.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, 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 core/server/utils/npm/preinstall.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs ghost
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls ghost
npm ERR! There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?

npm ERR! Please include the following file with any support request:
npm ERR!     /home/iampoxco/test/npm-debug.log
[test (6)] [iampoxco@world-319 test]$

Some info:

  • URL: https://iampox.com/test
  • I’ve tried with Ghost version 2.11.1 (with Node.js version 8.14.1) and Ghost version 0.11.12 (with Node.js version 6.15.1)

I’ve contacted my web hosting provider support, but they don’t really know why it doesn’t work when I try to install it since Node.js is installed and I have SSH access.

If someone could help me, it’d be really great! I’ve already installed Ghost locally on my computer (macOS) to play with it and I really love it.

Thanks and have a good day!

Paul


#2

Ghost 0.x is completely unsupported. Not sure you realise how out of date that software is, but you definitely shouldn’t be trying to install it on a production server!

When installing Ghost, you need to be able to install binary npm dependencies. This is less of an issue with Ghost 2.x. I would assume the errors were completely different.

The chances of this working without your hosts being involved are fairly slim I’d say. Old school webhosting hasn’t been able to keep up with the tech changes needed to host more modern tech, which is why VPS are so popular.

Still, if there’s an error for v2 that we can see, we can at least have a stab at explaining why it doesn’t work :slight_smile:


#3

Thank you for your answer.
I just tried with Ghost 2.11.1 and Node.js 8.14.1 and here’s the errors I’m getting when running npm install:

npm WARN deprecated nodemailer@0.7.1: All versions below 4.0.1 of Nodemailer are deprecated. See https://nodemailer.com/status/
npm WARN deprecated mailcomposer@0.2.12: This project is unmaintained
npm WARN deprecated minimatch@0.2.14: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated coffee-script@1.3.3: CoffeeScript on NPM has moved to "coffeescript" (no hyphen)
npm WARN deprecated pygmentize-bundled@2.1.1: no longer maintained
npm WARN deprecated text-encoding@0.6.4: no longer maintained
npm WARN deprecated samsam@1.3.0: This package has been deprecated in favour of @sinonjs/samsam
npm WARN deprecated nomnom@1.5.2: Package no longer supported. Contact support@npmjs.com for more info.
npm WARN deprecated mimelib@0.2.19: This project is unmaintained
npm WARN deprecated graceful-fs@1.2.3: please upgrade to graceful-fs 4 for compatibility with current and future versions of Node.js
npm WARN deprecated browserslist@1.7.7: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
npm WARN deprecated minimatch@0.3.0: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated circular-json@0.3.3: CircularJSON is in maintenance only, flatted is its successor.
npm WARN lifecycle The node binary used for scripts is /home/iampoxco/nodevenv/test/8/bin/node but npm is using /opt/alt/alt-nodejs8/root/usr/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.

> dtrace-provider@0.8.7 install /home/iampoxco/nodevenv/test/8/lib/node_modules/dtrace-provider
> node-gyp rebuild || node suppress-error.js

make : on entre dans le répertoire « /home/iampoxco/nodevenv/test/8/lib/node_modules/dtrace-provider/build »
  TOUCH Release/obj.target/DTraceProviderStub.stamp
make: on quitte le répertoire « /home/iampoxco/nodevenv/test/8/lib/node_modules/dtrace-provider/build »

> sqlite3@4.0.3 install /home/iampoxco/nodevenv/test/8/lib/node_modules/sqlite3
> node-pre-gyp install --fallback-to-build

node-pre-gyp WARN Using request for node-pre-gyp https download
node-pre-gyp ERR! install error
node-pre-gyp ERR! stack Error: ghost package.json is not node-pre-gyp ready:
node-pre-gyp ERR! stack package.json must declare these properties:
node-pre-gyp ERR! stack binary.module_name
node-pre-gyp ERR! stack binary.module_path
node-pre-gyp ERR! stack binary.host
node-pre-gyp ERR! stack     at validate_config (/home/iampoxco/nodevenv/test/8/lib/node_modules/node-pre-gyp/lib/util/versioning.js:220:15)
node-pre-gyp ERR! stack     at Object.module.exports.evaluate (/home/iampoxco/nodevenv/test/8/lib/node_modules/node-pre-gyp/lib/util/versioning.js:279:5)
node-pre-gyp ERR! stack     at install (/home/iampoxco/nodevenv/test/8/lib/node_modules/node-pre-gyp/lib/install.js:204:31)
node-pre-gyp ERR! stack     at Object.self.commands.(anonymous function) [as install] (/home/iampoxco/nodevenv/test/8/lib/node_modules/node-pre-gyp/lib/node-pre-gyp.js:52:37)
node-pre-gyp ERR! stack     at run (/home/iampoxco/nodevenv/test/8/lib/node_modules/node-pre-gyp/bin/node-pre-gyp:82:30)
node-pre-gyp ERR! stack     at Object.<anonymous> (/home/iampoxco/nodevenv/test/8/lib/node_modules/node-pre-gyp/bin/node-pre-gyp:134:1)
node-pre-gyp ERR! stack     at Module._compile (module.js:653:30)
node-pre-gyp ERR! stack     at Object.Module._extensions..js (module.js:664:10)
node-pre-gyp ERR! stack     at Module.load (module.js:566:32)
node-pre-gyp ERR! stack     at tryModuleLoad (module.js:506:12)
node-pre-gyp ERR! System Linux 3.10.0-962.3.2.lve1.5.24.7.el7.x86_64
node-pre-gyp ERR! command "/opt/alt/alt-nodejs8/root/usr/bin/node" "/home/iampoxco/nodevenv/test/8/lib/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /home/iampoxco/test
node-pre-gyp ERR! node -v v8.14.1
node-pre-gyp ERR! node-pre-gyp -v v0.10.3
node-pre-gyp ERR! not ok
ghost package.json is not node-pre-gyp ready:
package.json must declare these properties:
binary.module_name
binary.module_path
binary.host

> sharp@0.21.0 install /home/iampoxco/nodevenv/test/8/lib/node_modules/sharp
> (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)

module.js:550
    throw err;
    ^

Error: Cannot find module '/home/iampoxco/test/install/libvips'
    at Function.Module._resolveFilename (module.js:548:15)
    at Function.Module._load (module.js:475:25)
    at Function.Module.runMain (module.js:694:10)
    at startup (bootstrap_node.js:204:16)
    at bootstrap_node.js:625:3
module.js:550
    throw err;
    ^

Error: Cannot find module './lib/libvips'
    at Function.Module._resolveFilename (module.js:548:15)
    at Function.Module._load (module.js:475:25)
    at Module.require (module.js:597:17)
    at require (internal/module.js:11:18)
    at [eval]:1:13
    at ContextifyScript.Script.runInThisContext (vm.js:50:33)
    at Object.runInThisContext (vm.js:139:38)
    at Object.<anonymous> ([eval]-wrapper:6:22)
    at Module._compile (module.js:653:30)
    at evalScript (bootstrap_node.js:479:27)
gyp: Call to 'node -e "console.log(require('./lib/libvips').pkgConfigPath())"' returned exit status 1 while in binding.gyp. while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/lib/configure.js:345:16)
gyp ERR! stack     at emitTwo (events.js:126:13)
gyp ERR! stack     at ChildProcess.emit (events.js:214:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Linux 3.10.0-962.3.2.lve1.5.24.7.el7.x86_64
gyp ERR! command "/opt/alt/alt-nodejs8/root/usr/bin/node" "/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/iampoxco/nodevenv/test/8/lib/node_modules/sharp
gyp ERR! node -v v8.14.1
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok

> jsonpath@1.0.0 postinstall /home/iampoxco/nodevenv/test/8/lib/node_modules/jsonpath
> node lib/aesprim.js > generated/aesprim-browser.js

module.js:550
    throw err;
    ^

Error: Cannot find module '/home/iampoxco/test/lib/aesprim.js'
    at Function.Module._resolveFilename (module.js:548:15)
    at Function.Module._load (module.js:475:25)
    at Function.Module.runMain (module.js:694:10)
    at startup (bootstrap_node.js:204:16)
    at bootstrap_node.js:625:3
npm WARN ajv-keywords@2.1.1 requires a peer of ajv@^5.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: sqlite3@4.0.3 (node_modules/sqlite3):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: sqlite3@4.0.3 install: `node-pre-gyp install --fallback-to-build`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: sharp@0.21.0 (node_modules/sharp):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: sharp@0.21.0 install: `(node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! jsonpath@1.0.0 postinstall: `node lib/aesprim.js > generated/aesprim-browser.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the jsonpath@1.0.0 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/iampoxco/.npm/_logs/2019-01-17T16_02_51_194Z-debug.log

closed #4

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