Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Look for SF_NPM_REGISTRY #618

Merged
merged 1 commit into from
Oct 11, 2023
Merged

Look for SF_NPM_REGISTRY #618

merged 1 commit into from
Oct 11, 2023

Conversation

iowillhoit
Copy link
Contributor

What does this PR do?

We suggest using SF_NPM_REGISTRY

Deprecated environment variable: SFDX_NPM_REGISTRY. Please use SF_NPM_REGISTRY instead.

However, plugin-trust did not look for that env var when verifying signatures.

QA

You can link this to your locally installed sf. After linking and setting a bogus registry with SF_NPM_REGISTRY, you will see a warning

{
  errno: -3008,
  code: 'ENOTFOUND',
  syscall: 'getaddrinfo',
  hostname: 'registry.npmjs-foo.org'
},

What issues does this PR fix or reference?

forcedotcom/cli#2517
@W-14277809@

@WillieRuemmele
Copy link
Contributor

QA Notes


before:

setting the env had no effect

 ➜  SF_NPM_REGISTRY=abc.com sf plugins install @salesforce/plugin-packaging
Polling for new version(s) to become available on npm... done
Successfully validated digital signature for @salesforce/plugin-packaging.
Finished digital signature check.

after:
✅ : the env is respected

 ➜  SF_NPM_REGISTRY=abc.com sf plugins install @salesforce/plugin-packaging
    TypeError: Invalid URL
    Code: ERR_INVALID_URL

✅ : preferes SF_ over SFDX_ and prints a warning

 ➜  SF_NPM_REGISTRY=abc.com SFDX_NPM_REGISTRY=https://www.npmjs.com/ sf plugins install @salesforce/plugin-packaging
(node:46246) Warning: Deprecated environment variable: SFDX_NPM_REGISTRY. Please use SF_NPM_REGISTRY instead.

Your environment has both variables populated, and with different values. The value from SF_NPM_REGISTRY will be used.
(Use `node --trace-warnings ...` to show where the warning was created)
    TypeError: Invalid URL
    Code: ERR_INVALID_URL

@WillieRuemmele WillieRuemmele merged commit 2dbb79f into main Oct 11, 2023
10 checks passed
@WillieRuemmele WillieRuemmele deleted the ew/npm-registry branch October 11, 2023 20:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants