Ghost-CLI icon indicating copy to clipboard operation
Ghost-CLI copied to clipboard

Incorrect directory path used when providing --dir parameter.

Open dzaikos opened this issue 2 years ago • 0 comments

Summary

When passing ghost-cli the --dir parameter it incorrectly uses the value as $DIR/$DIR. For example, if passing --dir /var/www/ it will use /var/www/var/www/ at various times.

Steps to Reproduce

As a non-privileged user from the command line run:

  1. cd /
  2. ghost update --dir "/var/www/ghost" --no-prompt --no-check-mem

Where /var/www/ghost is the directory containing the ghost installation.

Log file

Knex: run
$ npm install sqlite3 --save
ENOENT: no such file or directory, open '/var/www/ghost3/var/www/ghost3/versions/5.9.1/node_modules/sqlite3/package.json'
Error: ENOENT: no such file or directory, open '/var/www/ghost3/var/www/ghost3/versions/5.9.1/node_modules/sqlite3/package.json'
    at Object.openSync (fs.js:497:3)
    at Object.readFileSync (fs.js:393:35)
    at Run.parseOpts [as parseArgv] (/var/www/ghost3/versions/5.9.1/node_modules/@mapbox/node-pre-gyp/lib/node-pre-gyp.js:181:37)
    at new Run (/var/www/ghost3/versions/5.9.1/node_modules/@mapbox/node-pre-gyp/lib/node-pre-gyp.js:90:8)
    at Object.exports.find (/var/www/ghost3/versions/5.9.1/node_modules/@mapbox/node-pre-gyp/lib/pre-binding.js:21:16)
    at Object.<anonymous> (/var/www/ghost3/versions/5.9.1/node_modules/sqlite3/lib/sqlite3-binding.js:3:29)
    at Module._compile (internal/modules/cjs/loader.js:1085:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
    at Module.load (internal/modules/cjs/loader.js:950:32)
    at Function.Module._load (internal/modules/cjs/loader.js:790:12)
    at Module.require (internal/modules/cjs/loader.js:974:19)
    at require (internal/modules/cjs/helpers.js:101:18)
    at Object.<anonymous> (/var/www/ghost3/versions/5.9.1/node_modules/sqlite3/lib/sqlite3.js:2:17)
    at Module._compile (internal/modules/cjs/loader.js:1085:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
    at Module.load (internal/modules/cjs/loader.js:950:32)
    at Function.Module._load (internal/modules/cjs/loader.js:790:12)
    at Module.require (internal/modules/cjs/loader.js:974:19)
    at require (internal/modules/cjs/helpers.js:101:18)
    at Client_SQLite3._driver (/var/www/ghost3/versions/5.9.1/node_modules/knex/lib/dialects/sqlite3/index.js:42:12)
    at Client_SQLite3.initializeDriver (/var/www/ghost3/versions/5.9.1/node_modules/knex/lib/client.js:190:26)
    at new Client (/var/www/ghost3/versions/5.9.1/node_modules/knex/lib/client.js:75:12)
✖ Updating to a major version
An error occurred.
Message: 'Knex: run
$ npm install sqlite3 --save
ENOENT: no such file or directory, open '/var/www/ghost3/var/www/ghost3/versions/5.9.1/node_modules/sqlite3/package.json''

Technical details

  • OS: Ubuntu, v20.04.4 LTS
  • Node Version: v14.19.1
  • Ghost-CLI Version: 1.22.0
  • Environment: development
  • Command: 'ghost update --dir /var/www/ghost3 --no-prompt --no-check-mem'

Bug submission checklist

Please fill out this checklist to acknowledge that you followed the requirements to submit a bug report.

  • [X] Tried to find help in the forum & docs
  • [X] Checked for existing issues
  • [X] Attached log file
  • [X] Provided technical details incl. operating system

dzaikos avatar Aug 18 '22 20:08 dzaikos