oclif: Cannot find module globby when running CLI
Do you want to request a feature or report a bug?
Bug
What is the current behavior?
Whenever I run a command on CLI built using oclif, I get the following error:
(node:8716) [MODULE_NOT_FOUND] Error Plugin: mycli: Cannot find module 'globby'
module: @oclif/config@1.6.33
task: not loading commands, globby not found
plugin: mycli
root: /Users/sumbhavsethia/.nvm/versions/node/v8.11.1/lib/node_modules/mycli
See more details with DEBUG=*
Installing globby globally resolves the issue
What is the expected behavior?
I should not have to install globby globally to be able to run the CLI. It should be installed as a dependency of oclif
More information
Node version: 8.11.1 oclif version: 1.4.33
package.json:
"dependencies": {
"@oclif/command": "^1.4.33",
"@oclif/config": "^1.6.33",
"@oclif/plugin-help": "^1.2.11",
"bluebird": "^3.5.1",
"bluebird-retry": "^0.11.0",
"chalk": "^2.3.2",
"command-exists": "^1.2.2",
"execa": "^0.10.0",
"hostile": "^1.3.1",
"inquirer": "^5.2.0",
"inquirer-path": "^1.0.0-beta5",
"joi": "^13.1.2",
"latest-version": "^3.1.0",
"lodash": "^4.17.5",
"ora": "^2.0.0",
"pg": "^7.4.1",
"portscanner": "^2.1.1",
"request": "^2.85.0",
"request-promise": "^4.2.2",
"semver": "^5.5.0",
"ssh-config": "^1.1.3",
"sshpk": "^1.14.1",
"sudo-prompt": "^8.2.0",
"table": "^4.0.3",
"tmp-promise": "^1.0.4",
"wait-port": "^0.2.2"
},
"oclif": {
"commands": "./src/commands",
"bin": "mybin",
"plugins": [
"@oclif/plugin-help"
],
"topics": {
"atopic": {
"description": "Manages atopic"
}
}
},
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 7
- Comments: 25 (8 by maintainers)
Commits related to this issue
- NUI-426 Refactor test-worker command to use aio instead of serverless (#7) - adapt test-worker for aio projects: + run tests for all workers by default + new option "-a" to select which worker'... — committed to adobe/aio-cli-plugin-asset-compute by alexkli 4 years ago
- chore(ci): added oclif manifest generation to release process It’s a bit unclear why exactly this is needed because it isn’t documented well by oclif, but there are some related issues that it seems t... — committed to strong-config/node by deleted user 4 years ago
I’m confused as to what the solution is here, and (at least in my experience), this has made for a pretty frustrating onboarding experience. If I follow the readme and install oclif, then generate a new cli, then try to run
--version, I get this error.I have no oclif manifest in the generated project directory, and there are 0 instances of “manifest” in the readme. Globally installing
globbydoesn’t help, and adding it to the generated project simply gives a new error:If I try to run
yarn prepackas some of the linked issues seem to imply, I get a different, equally concerning TypeScript error:I could absolutely just be missing something dumb, but I’ve run through the readme examples a few times and always end up here.
Edit: I’d been trying to generate a
multicli, but I triedsinglejust to see. For what it’s worth,singledoes not appear to have this issue for me.Edit #2: Took a shot in the dark and switched to 10 and…everything seems to be working. I’m just going to slowly back away and assume everything’s fine now.
To fix the error I had to delete .node_modules and run yarn install again. Im using the sfdx plugins which uses Ocliff.
I did
npm install --save-dev globbyand now it works.I ran through the steps here and did got the globby missing dependency mesage
https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_plugins.meta/sfdx_cli_plugins/cli_plugins_generate_prepare.htm
I tried to install it globally and did not work. The message is still being displayed. Could anybody help me with it?