Skip to content
This repository has been archived by the owner on Jan 29, 2023. It is now read-only.

Error: command hello:org not found caused by incorrect folder structure on plugin #80

Closed
pgonzaleznetwork opened this issue Nov 11, 2020 · 3 comments

Comments

@pgonzaleznetwork
Copy link

Summary

When using sfdx plugins:generate, the package.json file has an NPM script as follows

"commands": "./lib/commands"

but in the custom plugin directory structure, commands folder is under src folder.

This causes any plug-in commands to fail unless you change the NPM script to point to the correct filder.

Steps To Reproduce:

  1. Follow the steps documented here to scaffold a cli plugin https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_plugins.meta/sfdx_cli_plugins/cli_plugins_generate_scaffold.htm
  2. Run /bin/run hello:org

Result: hello:org is not a command

  1. Go to the package.json and modify the NPM script to point to src/commands
  2. Run /bin/run hello:org

Result: it works now

Expected result

The package.json NPM script should accurately reflect the directly structured provided.

Actual result

There's a mismatch between the NPM script and the directory structure.

Additional information

Feel free to attach a screenshot.

SFDX CLI Version(to find the version of the CLI engine run sfdx --version):

sfdx-cli/7.78.1-5a65d9dd2f darwin-x64 node-v12.18.3

SFDX plugin Version(to find the version of the CLI plugin run sfdx plugins --core)

@oclif/plugin-autocomplete 0.1.5 (core)
@oclif/plugin-commands 1.3.0 (core)
@oclif/plugin-help 3.2.0 (core)
@oclif/plugin-not-found 1.2.4 (core)
@oclif/plugin-plugins 1.9.1 (core)
@oclif/plugin-update 1.3.10 (core)
@oclif/plugin-warn-if-update-available 1.7.0 (core)
@oclif/plugin-which 1.0.3 (core)
@salesforce/sfdx-diff 0.0.6
@salesforce/sfdx-scanner 2.4.0
@salesforce/sfdx-trust 3.4.3 (core)
alias 1.1.2 (core)
analytics 1.12.1 (core)
auth 1.3.0 (core)
config 1.1.10 (core)
documentor 0.0.0 (link) /Users/pgonzalez/Documents/trailheadOrgs/org1/documentor
generator 1.1.3 (core)
salesforcedx 50.3.1 (core)
├─ templates 50.1.0 (core)
├─ @salesforce/sfdx-plugin-lwc-test 0.1.7 (core)
├─ salesforce-alm 50.3.1 (core)
├─ custom-metadata 1.0.10 (core)
└─ apex 0.1.2 (core)
sfdx-cli 7.78.1 (core)

OS and version:

MacOS Catalina version 10.15.7

@github-actions
Copy link
Contributor

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.

@mshanemc mshanemc transferred this issue from forcedotcom/cli Jan 8, 2021
@mshanemc
Copy link
Contributor

mshanemc commented Jan 8, 2021

I moved this to the plugin-generate repo, which tracks issues related to that command

@ghost
Copy link

ghost commented Jan 8, 2021

Duplicate of #74

@amphro amphro closed this as completed Jan 27, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants