forcedotcom / dependencies-cli

SFDX plugin for metadata dependencies tooling API
BSD 3-Clause "New" or "Revised" License
106 stars 18 forks source link

Error while installing the plugin #4

Closed melmoussaoui closed 4 years ago

melmoussaoui commented 4 years ago

The install script stops at the 2 step with following error : error dependencies-cli@2.0.0-beta: The engine "node" is incompatible with this module. Expected version ">=12.1.0". Got "10.15.3"

sfdx-cli version: 7.36.0-b1c4e9c7c8

error

JeroenSfdc commented 4 years ago

I'm also bit confused here as I'm getting error dependencies-cli@2.0.0-beta: The engine "node" is incompatible with this module. Expected version ">=12.1.0". Got "10.15.3" as well. However node -v shows v12.14.1.

hkache commented 4 years ago

I am not able to reproduce this. Running node v13.6.0 myself, I downgraded to v12.14.1 and still manage to install the plugin.

Only after downgrading one more to v10.18.1 it fails as expected:

error dependencies-cli@2.0.0-beta: The engine "node" is incompatible with this module. Expected version ">=12.1.0". Got "10.18.1"
error Found incompatible module.
Installing plugin dependencies-cli... !

What platform are you running on? Any chance you linked a different node version from the one referenced in your PATH?

hkache commented 4 years ago

On MacOS, run brew info node and make sure it compares with node -v.

JeroenSfdc commented 4 years ago

Indeed brew info node does not compare with node -v and neither nvm which current

node -v: v12.14.1 nvm which current: /Users/xxx/.nvm/versions/node/v12.14.1/bin/node brew info node: node: stable 13.6.0 (bottled), HEAD

But still 13.6.0 is not 10.15.3 ...

madaMM commented 4 years ago

I'm also not able to install the plugin because it gets stuck at "Fetching packages...": image

FabienTaillon commented 4 years ago

Plugin install is also failing silently for me:

dependency

I tried to linked it localy after git cloning it, and got the following error: error dependencies-cli@2.0.1: The engine "yarn" is incompatible with this module. Expected version ">=1.15.2". Got "1.12.3" After updated yarn, I'm getting this error while running yarn install:

node_modules/@salesforce/core/lib/config/configStore.d.ts:4:10 - error TS2440: Import declaration conflicts with local declaration of 'ConfigContents'.

4 import { ConfigContents } from './configStore';
yarn
melmoussaoui commented 4 years ago

@hkache the node version is the same in my case.

hkache commented 4 years ago

@JeroenSfdc would it work if you force brew link node to have a match of brew info node with node -v. That worked in my case.

hkache commented 4 years ago

@melmoussaoui I delivered a new version 2.0.1 and fixed build/install errors caused by outdated @salesforce/core package dependencies. Please try again.

hkache commented 4 years ago

To update please run

sfdx plugins:uninstall dependencies-cli followed by sfdx plugins:install dependencies-cli

Ignore warnings re. babel-preset-latest and expect this final output

Installing plugin dependencies-cli... installed v2.0.1

JeroenSfdc commented 4 years ago

@hkache keeps failing, vebose tail of log:


verbose 4.955 Request "https://registry.yarnpkg.com/has-values" finished with status code 200.
verbose 4.973 Request "https://registry.yarnpkg.com/isarray" finished with status code 200.
verbose 5.025 Request "https://registry.yarnpkg.com/object-copy" finished with status code 200.
verbose 5.026 Performing "GET" request to "https://registry.yarnpkg.com/copy-descriptor".
verbose 5.08 Request "https://registry.yarnpkg.com/copy-descriptor" finished with status code 200.
[2/4] Fetching packages...
Installing plugin dependencies-cli... !
jburgers-ltm4:~ jburgers$
JeroenSfdc commented 4 years ago

@JeroenSfdc would it work if you force brew link node to have a match of brew info node with node -v. That worked in my case.

brew info node will give the latest stable version of node (13.6.0) but I linked node@12 with brew link node@12 --force successfully.

brew info node@12 returns correctly 12.14.1.

ncnxx commented 4 years ago

Guys, I have a workaround. Please try cloning the repo to your local machine. Go inside the repo and run npm install. Then, run sfdx plugins:link . This works for me.

kacrouse commented 4 years ago

I worked around this issue by installing sfdx with npm instead of homebrew.

brew cask uninstall sfdx followed by npm install -g sfdx-cli

The version installed by homebrew does some quite a bit different than the version installed by npm. If you run sfdx -v when it's been installed with homebrew, it prints

sfdx-cli/7.41.0-2a5f766389 darwin-x64 node-v10.15.3

Whereas the node version printed when you run the same command after installing with npm appears to be whatever your local version of node is.

tet3 commented 4 years ago

As hinted at by @kacrouse , the root cause here is that the installers (at least for Windows & macOS) from https://developer.salesforce.com/tools/sfdxcli install node v10.15.3 in the bin directory from which the sfdx command gets called. This version of node gets used for sfdx even if you have a different version installed globally.

Uninstalling the sfdx version installed by the downloaded installer (which is probably what gets called by brew) and installing via npm is definitely the cleanest fix, but on my Windows machine it also works (so far, I haven't run a ton of sfdx commands yet) to copy the newer node executable (v12.14.1 in my case) over the older v10.15.3 one that shipped with sfdx.

JBX028 commented 4 years ago

Hi, Unfortunately the trick didn't worked for me on my macos. I never installed sfdx with brew so reinstalling with npm didn't helped...Should I open a new issue?