Skip to content

Conversation

@HomyeeKing
Copy link
Contributor

npm warn Unknown user config "home". This will stop working in the next major version of npm.

the home config was decrepated, so it'd better remove it from here as well.

@changeset-bot
Copy link

changeset-bot bot commented Jul 4, 2025

🦋 Changeset detected

Latest commit: 0424253

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
nrm Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@HomyeeKing
Copy link
Contributor Author

@iosh cc

@iosh
Copy link
Collaborator

iosh commented Jul 5, 2025

The test failed. I'll check it later

@HomyeeKing
Copy link
Contributor Author

@iosh it's the nrm home command failed, should we remove this command as well?

@iosh
Copy link
Collaborator

iosh commented Jul 6, 2025

@iosh it's the nrm home command failed, should we remove this command as well?

Yes, you're right, The nrm home command we should remove it.

@HomyeeKing
Copy link
Contributor Author

@iosh Maybe we could remain the home command and move the home field into ~/.nrmrc, so we can get rid of the warn message, what do you think?

@iosh
Copy link
Collaborator

iosh commented Jul 8, 2025

@iosh Maybe we could remain the home command and move the home field into ~/.nrmrc, so we can get rid of the warn message, what do you think?

I think we can either remove the command now or add a warning first and remove it later.

@HomyeeKing
Copy link
Contributor Author

@iosh
The intention of this PR is to get rid of the warning from npm, so I simply remove the home config before I read the code.

Now I realise the nrm home command is one of the feature of the nrm and I suggest to keep it, just put the NON_NPM_CONFIG in the nvmrc will be fine.

The warning disappear and no harm to the feature.

@iosh
Copy link
Collaborator

iosh commented Jul 10, 2025

I think we can stop write home field to .npmrc

export async function onUse(name: string) {
  const registries = await getRegistries();
  let alias = name;

  // if alias is undefined, select the registry alias from list
  if (alias === undefined) {
    alias = await select<string>({
      message: 'Please select the registry you want to use',
      choices: Object.keys(registries),
      pageSize: 10,
    });
  }

  if (await isRegistryNotFound(alias)) {
    return;
  }

  const registry = registries[alias];
  const npmrc = await readFile(NPMRC);
  await writeFile(NPMRC, Object.assign(npmrc, registry));

  printSuccess(`The registry has been changed to '${alias}'.`);
}
export async function onUse(name: string) {
  // ...
  // Don't write the`home` to .npmrc
  const {home:_, ...registry} = registries[alias];
  const npmrc = await readFile(NPMRC);
  await writeFile(NPMRC, Object.assign(npmrc, registry));

  printSuccess(`The registry has been changed to '${alias}'.`);
}

@HomyeeKing HomyeeKing changed the title Update constants.ts chore: remove home field from npmrc Jul 11, 2025
@iosh
Copy link
Collaborator

iosh commented Jul 11, 2025

@HomyeeKing Thanks, Could you please add a changeset for this PR? Please run npx changeset, choose minor, and use the following summary:: fix: Remove invalid home field from .npmrc. Thanks @HomyeeKing

@HomyeeKing
Copy link
Contributor Author

@iosh Done, thanks :)

@iosh iosh merged commit 2fe00e6 into Pana:master Jul 12, 2025
3 of 4 checks passed
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