-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
[BUG] config prefix cannot be changed from project config in ~/.npmrc #7501
Comments
@Konfekt value for prefix can not be changed from the project level |
But does the linked documentation not refer to |
yes it does. I am guessing that you might have ~/.npmrc already as per user config file. Do you also have |
Please do not abbreviate when making a bug report. The actual output of the error message tells us exactly what file is trying to set |
No, I only use npm to install executables, but do not use it for a project. $ npm
npm ERR! config prefix cannot be changed from project config: /home/konfekt/.npmrc.
npm <command>
Usage:
npm install install all the dependencies in your project
npm install <foo> add the <foo> dependency to your project
npm test run this project's tests
npm run <foo> run the script named <foo>
npm <command> -h quick help on <command>
npm -l display usage info for all commands
npm help <term> search for help on <term>
npm help npm more involved overview
All commands:
access, adduser, audit, bugs, cache, ci, completion,
config, dedupe, deprecate, diff, dist-tag, docs, doctor,
edit, exec, explain, explore, find-dupes, fund, get, help,
help-search, hook, init, install, install-ci-test,
install-test, link, ll, login, logout, ls, org, outdated,
owner, pack, ping, pkg, prefix, profile, prune, publish,
query, rebuild, repo, restart, root, run-script, sbom,
search, set, shrinkwrap, star, stars, start, stop, team,
test, token, uninstall, unpublish, unstar, update, version,
view, whoami
Specify configs in the ini-formatted file:
/home/konfekt/.config/.npmrc
or on the command line via: npm <command> --key=value
More configuration info: npm help config
Configuration fields: npm help 7 config
[email protected] /usr/lib64/node_modules/npm18 |
Is there a package.json file in |
Hello! No, there is none. The home folder is rather limpid. |
This seems to originate from cli/workspaces/config/lib/index.js Line 632 in e40454c
So |
The localPrefix seems in cli/workspaces/config/lib/index.js Line 704 in e40454c
~/ , say, so that the project config and user config collide.
In other directories, different from Why this warning inside |
what does
|
Here we go.
|
Here's what's happening
I think at this point you need to pare down your config chain, this is not a set up we can support. |
Understood, thank you very much for your time and clearing this up. I forgot about this environment variable |
Is there an existing issue for this?
This issue exists in the latest npm version
Current Behavior
With a
prefix
setting in~/.npmrc
pointing to a custom directory to install the user's global packages to withnpm 10.5.0
on Ubuntu 22.04 and Opensuse 15.5, the error message introduced in #6685 shows up every time.Expected Behavior
No error message as previously or instructions how to fix the prefix
Steps To Reproduce
Add a
prefix
setting in~/.npmrc
pointing to a custom directory to install the user's global packages to.Now, with
npm 10.5.0
on Ubuntu 22.04 and Opensuse 15.5, this error message shows up every time.Environment
prefix=/home/konfekt/.local/share/npm-packages
The text was updated successfully, but these errors were encountered: