0

I have a custom DX plugin hosted on an internal GitHub Enterprise repo.

When I try and run

sfdx plugins:install [email protected]:myusername/my-repo.git

it returns:

(node:18800) Error Plugin: sfdx-cli: could not find package.json with { type: 'link',
  root: 'C:\\Users\\myusername\\Desktop\\my-repo',
  name: 'my-repo',
  tag: undefined }
module: @oclif/[email protected]
task: loadPlugins
plugin: sfdx-cli
root: C:\Users\myusername\AppData\Local\sfdx\client\7.62.1-309fe6da17
See more details with DEBUG=*
Installing plugin @it... yarn add v1.21.1
(node:18800) MissingOrInvalidNpmName Plugin: sfdx-cli: The npm name is missing or invalid.
module: @oclif/[email protected]
task: runHook plugins:preinstall:verify:signature
plugin: sfdx-cli
root: C:\Users\myusername\AppData\Local\sfdx\client\7.62.1-309fe6da17
See more details with DEBUG=*
Installing plugin @it... [1/4] Resolving packages...Installing plugin @it... info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.Installing plugin @it... !
error An unexpected error occurred: "https://registry.npmjs.org/@it: Request \"https://registry.npmjs.org/@it\" returned a 405".
Error: yarn add @[email protected]:myusername/my-repo.git --non-interactive --mutex=file:C:/Users/myusername/AppData/Local/sfdx/yarn.lock --preferred-cache-folder=C:/Users/myusername/AppData/Local/sfdx/yarn --check-files exited with code 1
    at ChildProcess.forked.on (C:/Users/myusername/AppData/Local/sfdx/client/7.62.1-309fe6da17/node_modules/@oclif/plugin-plugins/lib/yarn.js:31:28)

My .yarnrc and .npmrc both have strict-ssl set to false and my .npmrc has proxy and https-proxy set to my corporate proxy endpoint

Any suggestions?

1 Answer 1

1

It's trying to install from npmjs.org, which is not where your code lives. Instead, I'd use git clone and plugins:link:

git clone [email protected]:myusername/my-repo.git
sfdx plugins:link my-repo

This will link the plugin to your CLI and enable it to be used.

3
  • so if I were to change my registry to my GitHub endpoint, or any other registry (Nexus, Artifactory, etc.) should that in theory work as well?
    – trebleCode
    Commented Aug 20, 2020 at 15:19
  • 1
    @trebleCode Yes, that should work.
    – sfdcfox
    Commented Aug 20, 2020 at 15:21
  • if I try linking I get an error message saying could not find package.json with { type: 'dev', root: 'C:\\Users\\myusername\\Desktop\\my-repo', name: '@oclif/plugin-help'}. What does that mean?
    – trebleCode
    Commented Aug 20, 2020 at 15:30

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .