SFDX 7.129.0 installed with npm does not work with node lts (16.13.0)
Summary
SFDX 7.129.0 installed with npm does not work with node lts (16.13.0)
Steps To Reproduce:
- npm install 16.13.0
- npm i -g [email protected]
- 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
- Run
- If you are using
sf- Run
sf versionANDsf plugins --core
- Run
- 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.
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.
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.
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
Also facing the issue when linking a plugin :(
@DougMidgley how are u linking a plugin? And which plugin is it?
@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
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.