“npm install ghost-cli” creates unsupported version of node (v8.2.1)

I’m having a strange issue, which Vikas suggested I post here.

Using node v8.9.4 or v8.15.0 to install ghost, since that’s what’s supported, the installer manages to create a node v8.2.1 directory and then install itself there anyway.

This leads to:

One or more errors occurred.

1) Checking system Node.js version

Message: The version of Node.js you are using is not supported.
Supported: ^6.9.0 || ^8.9.0 || ^10.13.0
Installed: 8.2.1
See https://docs.ghost.org/faq/node-versions/ for more information

Am I missing something?

PS: I can still get Ghost to install & run successfully in node v8.2.1, I just don’t get what’s happening here.

Definitely weird. I just renamed the topic to make it clearer that you’re installing the cli and not Ghost directly (which isn’t supported)

Ah yes, thank you for that! Looking forward to some clarity on this.

Just in case, can you run the following in your terminal? nvm which system
If there’s an output from that $(nvm which system) -- version

Update: Actually maybe just nvm ls :grimacing:

Sure! With current setup, it returns:

         v8.2.1
         v8.9.4
        v8.15.0
->      v11.6.0
         system
default -> node (-> v11.6.0)
node -> stable (-> v11.6.0) (default)
stable -> 11.6 (-> v11.6.0) (default)
iojs -> N/A (default)
lts/* -> lts/dubnium (-> N/A)
lts/argon -> v4.9.1 (-> N/A)
lts/boron -> v6.16.0 (-> N/A)
lts/carbon -> v8.15.0
lts/dubnium -> v10.15.1 (-> N/A)

Maybe uninstall the previous node versions if you don’t need them? Not sure if this would help, but might force the cli to use the current version instead of an old one.

Hey @dsecareanu, as you’ll see in my terminal screenshot, v8.2 was not installed prior to running npm install ghost-cli…

It still managed to create a v8.2 install and save itself there.

This is a weird one for sure, but I’m pretty sure it’s not a Ghost thing :smiley:

Ghost CLI doesn’t have any ability to install node versions. It has some code for detecting versions, but nothing for installing.

The tool that is in play that does have the ability to install node versions is nvm, and we can clearly see that in fact it is nvm that is creating a new node version because the new node version ends up inside of nvm’s folder structure.

nvm has a few different ways of determining when to install a new version of node, the main one that I am aware of being .nvmrc files. There are no .nvmrc files in Ghost or Ghost-CLI at present.

My best guess is that you have a rogue .nvmrc file somewhere, or some other nvm config that’s confusing nvm into installing a new node version before installing the global.

As for where - maybe in the folder or parent of your current working dir when you’re trying to install Ghost-CLI, or maybe in your home folder, or any folders to do with where npm or nvm install things.

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