cli icon indicating copy to clipboard operation
cli copied to clipboard

SFDX 7.129.0 installed with npm does not work with node lts (16.13.0)

Open loter opened this issue 4 years ago • 6 comments

Summary

SFDX 7.129.0 installed with npm does not work with node lts (16.13.0)

Steps To Reproduce:

  1. npm install 16.13.0
  2. npm i -g [email protected]
  3. sfdx --version fails with the following errors:
sh-3.2$ sfdx --version
(node:41850) Error Plugin: sfdx-cli: could not find package.json with {
  type: 'user',
  root: '/Users/dragomirenachi/.local/share/sfdx/package.json',
  name: 'sfdx-hardis',
  tag: 'latest'
}
module: @oclif/[email protected]
task: loadPlugins
plugin: sfdx-cli
root: /Users/dragomirenachi/.nvm/versions/node/v16.13.0/lib/node_modules/sfdx-cli
See more details with DEBUG=*
(Use `node --trace-warnings ...` to show where the warning was created)
(node:41850) Error Plugin: sfdx-cli: could not find package.json with {
  type: 'core',
  root: '/Users/dragomirenachi/.nvm/versions/node/v16.13.0/lib/node_modules/sfdx-cli',
  name: '@oclif/plugin-autocomplete'
}
module: @oclif/[email protected]
task: loadPlugins
plugin: sfdx-cli
root: /Users/dragomirenachi/.nvm/versions/node/v16.13.0/lib/node_modules/sfdx-cli
See more details with DEBUG=*
(node:41850) Error Plugin: sfdx-cli: could not find package.json with {
  type: 'core',
  root: '/Users/dragomirenachi/.nvm/versions/node/v16.13.0/lib/node_modules/sfdx-cli',
  name: '@oclif/plugin-commands'
}
module: @oclif/[email protected]
task: loadPlugins
plugin: sfdx-cli
root: /Users/dragomirenachi/.nvm/versions/node/v16.13.0/lib/node_modules/sfdx-cli
See more details with DEBUG=*
(node:41850) Error Plugin: sfdx-cli: could not find package.json with {
  type: 'core',
  root: '/Users/dragomirenachi/.nvm/versions/node/v16.13.0/lib/node_modules/sfdx-cli',
  name: '@oclif/plugin-warn-if-update-available'
}
module: @oclif/[email protected]
task: loadPlugins
plugin: sfdx-cli
root: /Users/dragomirenachi/.nvm/versions/node/v16.13.0/lib/node_modules/sfdx-cli
See more details with DEBUG=*
(node:41850) Error Plugin: sfdx-cli: could not find package.json with {
  type: 'core',
  root: '/Users/dragomirenachi/.nvm/versions/node/v16.13.0/lib/node_modules/sfdx-cli',
  name: '@oclif/plugin-update'
}
module: @oclif/[email protected]
task: loadPlugins
plugin: sfdx-cli
root: /Users/dragomirenachi/.nvm/versions/node/v16.13.0/lib/node_modules/sfdx-cli
See more details with DEBUG=*
(node:41850) Error Plugin: sfdx-cli: could not find package.json with {
  type: 'core',
  root: '/Users/dragomirenachi/.nvm/versions/node/v16.13.0/lib/node_modules/sfdx-cli',
  name: '@oclif/plugin-which'
}
module: @oclif/[email protected]
task: loadPlugins
plugin: sfdx-cli
root: /Users/dragomirenachi/.nvm/versions/node/v16.13.0/lib/node_modules/sfdx-cli
See more details with DEBUG=*
(node:41850) Error Plugin: sfdx-cli: could not find package.json with {
  type: 'core',
  root: '/Users/dragomirenachi/.nvm/versions/node/v16.13.0/lib/node_modules/sfdx-cli',
  name: '@salesforce/plugin-auth'
}
module: @oclif/[email protected]
task: loadPlugins
plugin: sfdx-cli
root: /Users/dragomirenachi/.nvm/versions/node/v16.13.0/lib/node_modules/sfdx-cli
See more details with DEBUG=*
(node:41850) Error Plugin: sfdx-cli: could not find package.json with {
  type: 'core',
  root: '/Users/dragomirenachi/.nvm/versions/node/v16.13.0/lib/node_modules/sfdx-cli',
  name: '@salesforce/plugin-custom-metadata'
}
module: @oclif/[email protected]
task: loadPlugins
plugin: sfdx-cli
root: /Users/dragomirenachi/.nvm/versions/node/v16.13.0/lib/node_modules/sfdx-cli
See more details with DEBUG=*
(node:41850) Error Plugin: sfdx-cli: could not find package.json with {
  type: 'core',
  root: '/Users/dragomirenachi/.nvm/versions/node/v16.13.0/lib/node_modules/sfdx-cli',
  name: '@salesforce/plugin-data'
}
module: @oclif/[email protected]
task: loadPlugins
plugin: sfdx-cli
root: /Users/dragomirenachi/.nvm/versions/node/v16.13.0/lib/node_modules/sfdx-cli
See more details with DEBUG=*
(node:41850) Error Plugin: sfdx-cli: could not find package.json with {
  type: 'core',
  root: '/Users/dragomirenachi/.nvm/versions/node/v16.13.0/lib/node_modules/sfdx-cli',
  name: '@salesforce/plugin-alias'
}
module: @oclif/[email protected]
task: loadPlugins
plugin: sfdx-cli
root: /Users/dragomirenachi/.nvm/versions/node/v16.13.0/lib/node_modules/sfdx-cli
See more details with DEBUG=*
(node:41850) Error Plugin: sfdx-cli: could not find package.json with {
  type: 'core',
  root: '/Users/dragomirenachi/.nvm/versions/node/v16.13.0/lib/node_modules/sfdx-cli',
  name: '@salesforce/plugin-apex'
}
module: @oclif/[email protected]
task: loadPlugins
plugin: sfdx-cli
root: /Users/dragomirenachi/.nvm/versions/node/v16.13.0/lib/node_modules/sfdx-cli
See more details with DEBUG=*
(node:41850) Error Plugin: sfdx-cli: could not find package.json with {
  type: 'core',
  root: '/Users/dragomirenachi/.nvm/versions/node/v16.13.0/lib/node_modules/sfdx-cli',
  name: '@salesforce/plugin-config'
}
module: @oclif/[email protected]
task: loadPlugins
plugin: sfdx-cli
root: /Users/dragomirenachi/.nvm/versions/node/v16.13.0/lib/node_modules/sfdx-cli
See more details with DEBUG=*
(node:41850) Error Plugin: sfdx-cli: could not find package.json with {
  type: 'core',
  root: '/Users/dragomirenachi/.nvm/versions/node/v16.13.0/lib/node_modules/sfdx-cli',
  name: '@salesforce/plugin-limits'
}
module: @oclif/[email protected]
task: loadPlugins
plugin: sfdx-cli
root: /Users/dragomirenachi/.nvm/versions/node/v16.13.0/lib/node_modules/sfdx-cli
See more details with DEBUG=*
(node:41850) Error Plugin: sfdx-cli: could not find package.json with {
  type: 'core',
  root: '/Users/dragomirenachi/.nvm/versions/node/v16.13.0/lib/node_modules/sfdx-cli',
  name: '@salesforce/plugin-org'
}
module: @oclif/[email protected]
task: loadPlugins
plugin: sfdx-cli
root: /Users/dragomirenachi/.nvm/versions/node/v16.13.0/lib/node_modules/sfdx-cli
See more details with DEBUG=*
(node:41850) Error Plugin: sfdx-cli: could not find package.json with {
  type: 'core',
  root: '/Users/dragomirenachi/.nvm/versions/node/v16.13.0/lib/node_modules/sfdx-cli',
  name: '@salesforce/plugin-source'
}
module: @oclif/[email protected]
task: loadPlugins
plugin: sfdx-cli
root: /Users/dragomirenachi/.nvm/versions/node/v16.13.0/lib/node_modules/sfdx-cli
See more details with DEBUG=*
(node:41850) Error Plugin: sfdx-cli: could not find package.json with {
  type: 'core',
  root: '/Users/dragomirenachi/.nvm/versions/node/v16.13.0/lib/node_modules/sfdx-cli',
  name: '@salesforce/plugin-schema'
}
module: @oclif/[email protected]
task: loadPlugins
plugin: sfdx-cli
root: /Users/dragomirenachi/.nvm/versions/node/v16.13.0/lib/node_modules/sfdx-cli
See more details with DEBUG=*
(node:41850) Error Plugin: sfdx-cli: could not find package.json with {
  type: 'core',
  root: '/Users/dragomirenachi/.nvm/versions/node/v16.13.0/lib/node_modules/sfdx-cli',
  name: '@salesforce/plugin-telemetry'
}
module: @oclif/[email protected]
task: loadPlugins
plugin: sfdx-cli
root: /Users/dragomirenachi/.nvm/versions/node/v16.13.0/lib/node_modules/sfdx-cli
See more details with DEBUG=*
(node:41850) Error Plugin: sfdx-cli: could not find package.json with {
  type: 'core',
  root: '/Users/dragomirenachi/.nvm/versions/node/v16.13.0/lib/node_modules/sfdx-cli',
  name: '@salesforce/plugin-trust'
}
module: @oclif/[email protected]
task: loadPlugins
plugin: sfdx-cli
root: /Users/dragomirenachi/.nvm/versions/node/v16.13.0/lib/node_modules/sfdx-cli
See more details with DEBUG=*
(node:41850) Error Plugin: sfdx-cli: could not find package.json with {
  type: 'core',
  root: '/Users/dragomirenachi/.nvm/versions/node/v16.13.0/lib/node_modules/sfdx-cli',
  name: '@salesforce/plugin-user'
}
module: @oclif/[email protected]
task: loadPlugins
plugin: sfdx-cli
root: /Users/dragomirenachi/.nvm/versions/node/v16.13.0/lib/node_modules/sfdx-cli
See more details with DEBUG=*
(node:41850) Error Plugin: sfdx-cli: could not find package.json with {
  type: 'core',
  root: '/Users/dragomirenachi/.nvm/versions/node/v16.13.0/lib/node_modules/sfdx-cli',
  name: '@salesforce/sfdx-plugin-lwc-test'
}
module: @oclif/[email protected]
task: loadPlugins
plugin: sfdx-cli
root: /Users/dragomirenachi/.nvm/versions/node/v16.13.0/lib/node_modules/sfdx-cli
See more details with DEBUG=*
(node:41850) Error Plugin: sfdx-cli: could not find package.json with {
  type: 'core',
  root: '/Users/dragomirenachi/.nvm/versions/node/v16.13.0/lib/node_modules/sfdx-cli',
  name: '@salesforce/plugin-templates'
}
module: @oclif/[email protected]
task: loadPlugins
plugin: sfdx-cli
root: /Users/dragomirenachi/.nvm/versions/node/v16.13.0/lib/node_modules/sfdx-cli
See more details with DEBUG=*
(node:41850) Error Plugin: sfdx-cli: could not find package.json with {
  type: 'core',
  root: '/Users/dragomirenachi/.nvm/versions/node/v16.13.0/lib/node_modules/sfdx-cli/node_modules/@salesforce/plugin-generator',
  name: '@oclif/plugin-warn-if-update-available'
}
module: @oclif/[email protected]
task: loadPlugins
plugin: sfdx-cli
root: /Users/dragomirenachi/.nvm/versions/node/v16.13.0/lib/node_modules/sfdx-cli
See more details with DEBUG=*
sfdx-cli/7.129.0 darwin-x64 node-v16.13.0

Expected result

display sfdx version

Actual result

fails

System Information

  • If you are using sfdx
    • Run sfdx version --verbose --json - fails
  • If you are using sf
    • Run sf version AND sf plugins --core
  • Paste the output here
sh-3.2$ sf version
@salesforce/cli/1.4.0 darwin-x64 node-v16.13.0
sh-3.2$ sf plugins --core
You acknowledge and agree that the CLI tool may collect usage information, user environment, and crash reports for the purposes of providing services or functions that are relevant to use of the CLI tool and product improvements.

@oclif/plugin-help 5.1.1 (core)
@oclif/plugin-not-found 2.2.0 (core)
@oclif/plugin-plugins 2.0.1 (core)
@salesforce/cli 1.4.0 (core)
config 2.2.10 (core)
deploy-retrieve 1.0.5 (core)
deploy-retrieve-metadata 1.0.7 (core)
env 1.0.3 (core)
functions 1.1.7 (core)
generate 1.0.5 (core)
login 1.0.5 (core)
telemetry 1.2.8 (core)

Additional information

bang.

loter avatar Nov 29 '21 22:11 loter

Thank you for filing this issue. We appreciate your feedback and will review the issue as soon as possible. Remember, however, that GitHub isn't a mechanism for receiving support under any agreement or SLA. If you require immediate assistance, contact Salesforce Customer Support.

github-actions[bot] avatar Nov 29 '21 22:11 github-actions[bot]

I'm still using node 14 because jest tests are not working with the 16. Is there a reason for upgrading to node 16, besides the doc recommending to do so?

According to this doc it's recommended to use sfdx with the "active lts" node version, which is the 16 at the moment.

AllanOricil avatar Nov 30 '21 02:11 AllanOricil

I'm still using node 14 because jest tests are not working with the 16. Is there a reason for upgrading to node 16, besides the doc recommending to do so?

According to this doc it's recommended to use sfdx with the "active lts" node version, which is the 16 at the moment.

node14 is fine

mshanemc avatar Nov 30 '21 21:11 mshanemc

Also facing the issue when linking a plugin :(

DougMidgley avatar Aug 12 '22 07:08 DougMidgley

@DougMidgley how are u linking a plugin? And which plugin is it?

AllanOricil avatar Aug 12 '22 19:08 AllanOricil

@AllanOricil Its a custom plugin (not published as is private, so its not installing, but linking) below is the the sample. Note: the plugin works perfectly fine, just with this error which causes some concern to users.

> sfdx plugins:link ../sfdx-CLIENT
›   Warning: sfdx-cli update available from 7.162.0 to 7.163.0.
Linking plugin ../sfdx-CLIENT...
sfdx-cli: linking plugin sfdx-CLIENT... done
(node:1838) Error Plugin: sfdx-CLIENT: could not find package.json with {
  type: 'dev',
  root: '/home/vsts/work/1/s/sfdx-CLIENT',
  name: '@oclif/plugin-help'
}
module: @oclif/[email protected]
task: loadPlugins
plugin: sfdx-CLIENT
root: /home/vsts/work/1/s/sfdx-CLIENT
See more details with DEBUG=*
(Use `node --trace-warnings ...` to show where the warning was created)

Interestingly, this only happens when linking on the Azure DevOps Linux machine, when doing locally with Windows, no errors show

DougMidgley avatar Aug 13 '22 10:08 DougMidgley

we've changed the code for plugins:link https://github.com/oclif/plugin-plugins/pull/517

You should see linked plugins compile themselves now, which I think was maybe at the root of some of this thread. As always, if you've got something still broken that's reproducible, please open a new issue.

mshanemc avatar Feb 13 '23 15:02 mshanemc