Ghost-CLI: Ghost-CLI 1.5.2 fails in a loop
A case exists on the problem see #9511. Since it’s closed, I was told to open another one, which I am doing here.
Issue Summary
When proceeding with the standard “ghostuser” account and use “sudo”, on a Debian Stretch Linux (9.4), with NodeJS v8.10.0 installed, I try to install Ghost-CLI v1.5.2, it starts and runs in a loop.
Here are the details below:
Steps to Reproduce
- Create a New User
adduser ghostuser
cat /etc/passwd
ghostuser:x:1002:1002:Ghost User,,,:/home/ghostuser:/bin/bash
- Super User Privileges
usermod -aG sudo ghostuser
- Installation NodeJS v8.10.0 and NPM
ghostuser@host:~$ sudo apt install apt-transport-https
ghostuser@host:~$ curl -sL https://deb.nodesource.com/setup_8.x | bash -
ghostuser@host:~$ sudo apt install -y nodejs
ghostuser@host:~$ sudo apt install -y build-essential
- Check NodeJS and NPM versions
ghostuser@host:~$ node -v && npm -v
v8.10.0
5.6.0
- Installation Ghost-CLI v1.5.2 (for now the lasted)
ghostuser@host:~$ sudo npm i -g ghost-cli@latest
npm WARN deprecated yarn@1.3.2: It is recommended to install Yarn using the native installation method for your environment. See https://yarnpkg.com/en/docs/install
npm WARN deprecated fs-promise@0.5.0: Use mz or fs-extra^3.0 with Promise Support
gyp WARN EACCES user "root" does not have permission to access the dev dir "/usr/lib/node_modules/ghost-cli/node_modules/dtrace-provider/.node-gyp/8.10.0"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/lib/node_modules/ghost-cli/node_modules/dtrace-provider/.node-gyp"
...
Sorry but same issue with ‘sudo’ and need a break ‘Ctrl+C’ to exit this loop.
BUT, really curious, if repeat install Ghost-CLI, this upgrade and done :
ghostuser@host:~$ sudo npm i -g ghost-cli@latest
[sudo] Mot de passe de ghostuser :
npm WARN deprecated yarn@1.3.2: It is recommended to install Yarn using the native installation method for your environment. See https://yarnpkg.com/en/docs/install
npm WARN deprecated fs-promise@0.5.0: Use mz or fs-extra^3.0 with Promise Support
/usr/bin/ghost -> /usr/lib/node_modules/ghost-cli/bin/ghost
+ ghost-cli@1.5.2
updated 1 package in 7.703s
Check :
ghostuser@host:~$ ghost version
Ghost-CLI version: 1.5.2
I repeated the same test twice and it reproduces the same problem well: first install failed in loop, break this with Ctrl+C and try second install, this indicate rollback then upgrade and done.
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 29 (23 by maintainers)
Commits related to this issue
- chore(deps): remove ghost-ignition in favor of hardcoded pretty-stream class closes #675 [ci skip] - drop ghost-ignition dependency - add pretty-stream class from ghost-ignition — committed to acburdine/Ghost-CLI by acburdine 6 years ago
- chore(deps): drop ghost-ignition, add pretty-stream class closes #675 [ci skip] - drop ghost-ignition dependency - add pretty-stream class from ghost-ignition — committed to acburdine/Ghost-CLI by acburdine 6 years ago
- chore(deps): drop ghost-ignition, add pretty-stream class closes #675 [ci skip] - drop ghost-ignition dependency - add pretty-stream class from ghost-ignition — committed to acburdine/Ghost-CLI by acburdine 6 years ago
- chore(deps): drop ghost-ignition, add pretty-stream class closes #675 - drop ghost-ignition dependency - add pretty-stream class from ghost-ignition — committed to acburdine/Ghost-CLI by acburdine 6 years ago
- chore(deps): drop ghost-ignition, add pretty-stream class closes #675 - drop ghost-ignition dependency - add pretty-stream class from ghost-ignition — committed to TryGhost/Ghost-CLI by acburdine 6 years ago
- fix(update-check): swap out update-notifier for simpler check closes #675 - remove update-notifier because we weren't using most of its dependencies - use latest-version and a simple semver check ins... — committed to acburdine/Ghost-CLI by acburdine 6 years ago
- fix(update-check): swap out update-notifier for simpler check closes #675 - remove update-notifier because we weren't using most of its dependencies - use latest-version and a simple semver check ins... — committed to TryGhost/Ghost-CLI by acburdine 6 years ago
- feat(pre-checks): add ~/.config folder ownership to pre-run checks closes #675 - convert update check to a listr task set - add ~/.config directory check to list of prechecks — committed to acburdine/Ghost-CLI by acburdine 6 years ago
- feat(pre-checks): add ~/.config folder ownership to pre-run checks closes #675 - convert update check to a listr task set - add ~/.config directory check to list of prechecks — committed to acburdine/Ghost-CLI by acburdine 6 years ago
- feat(pre-checks): add ~/.config folder ownership to pre-run checks closes #675 - convert update check to a listr task set - add ~/.config directory check to list of prechecks — committed to TryGhost/Ghost-CLI by acburdine 6 years ago
I tested this on Ubuntu and error appeared. This solution worked for me:
https://stackoverflow.com/questions/49529696/yarn-error-eaccess-permission-denied-scandir-home-ubuntu-config-yarn-link
here is solution: https://forum.ghost.org/t/an-unexpected-error-occurred-eacces-permission-denied/2834
sudo chown <username>:<username> ~/.config@cmlanche yup - gonna add that into the CLI here soon.
90% sure this is caused by: https://www.npmjs.com/package/configstore This dependency writes a file into
~/.config. Used byupdate-notifierdependency. Used here:/lib/utils/update-check.jsThe
.configfolder get’s created during the CLI installation. It will contain a file calledupdate-notifier-npm.json:There must be a postinstall hook somewhere.
So after some deliberation on slack, instead of adding docs to try and work around whatever the issue is in npm/node-gyp, we’re gonna remove the dependency on ghost-ignition in favor of extracting the prettylogger class (which is the only file from ghost-ignition that is used). That way, the dtrace-provider dependency (pulled in by ghost-ignition) won’t be installed.
Gonna close this because this isn’t a CLI issue, and is rather an issue with npm/node-gyp. According to this issue, the fix is to install with
sudo npm install -g --unsafe-perm ghost-cli.There’s not much that I can do to remove the gyp dependency short of removing our dependency on
ghost-ignition(which we use for a couple of things).