Skip to content

from version nodejs 15 I get an error: Error: double-loading config .. .npmrc" as "user", previously loaded as "project" #4193

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

Closed
kad-meedel opened this issue Jun 22, 2023 · 14 comments
Labels

Comments

@kad-meedel
Copy link

Details

When I want to use nodejs version 15 or higher I get the following error when trying to do a npm install xxx or even a npm config list.

The error I get is:

Error: double-loading config "/var/jenkins_data/workspace/test-scripts_test-nodejs-19/.npmrc" as "user", previously loaded as "project"
My 'default' .npmrc file is in the home dir of the user.
So I overwrite some settings within the project npmrc

Node.js version

The problem shows up from nodejs 15 and higher

Example code

No response

Operating system

jenkins environment within linux server

Scope

install packages

Module and version

From nodejs 15 and higher

@Gloriouspete
Copy link

You seem to be having a configuration conflict with the npmrc file,
A helpful solution would be to reset Npm with npm config delete userconfig and then install it back ,

we're also using node 18 currently so i'd advice you upgrade to node 18, sometimes old versions causes these issues,

if all these still doesn't work, use npm cache clean --force to clear unnecessary cache that may be causing conflict.

Good luck.

@kad-meedel
Copy link
Author

Gloriouspete, thanks for your quick reply.
I wil try you suggestions.

Thanks

@Gloriouspete
Copy link

You're welcome, I'd be expecting feedback

@kad-meedel
Copy link
Author

I changed my setting NPM_CONFIG_USERCONFIG to NODE_CONFIG_DIR
For my tests it wil be ok.
The errors are gone

@preveen-stack
Copy link
Contributor

@kad-meedel If your issue is solved, would you mind closing the issue

@Gloriouspete
Copy link

Use .npmrc.development then you can load it like that in your env.

But the issue is caused because you have the same npmrc file in both user and project

@joemdjossou
Copy link

joemdjossou commented Aug 22, 2023

I got this kind of error but instead of <<as "user", previously loaded as "project">>
It is as as \.cache\firebase\runtime\npmrc" as "global", previously loaded as "user"

I was trying to run the binary for the Firebase CLI in order to list my Firebase projects but when I enter any command under npm it flashes the error stated above.
@Gloriouspete can you help me figure it out?

@Gloriouspete
Copy link

@joemdjossou have you tried npm cache clean , also what version of node are you using

@joemdjossou
Copy link

joemdjossou commented Aug 22, 2023

I'm using the node veersion 18.17.1
I tried it but it has given me an error
I then tried npm cache clean --force

This was the answer
npm WARN using --force Recommended protections disabled

But still getting under binary for the Firebase CLI
.cache\firebase\runtime\npmrc" as "global", previously loaded as "user"
@Gloriouspete

@Gloriouspete
Copy link

Try verifying your installation steps .

An easy way would be to uninstall firebase-cli

Use npm uninstall -g firebase-tools to uninstall then install again correctly implementing the installation steps.
It should fix it

@joemdjossou
Copy link

joemdjossou commented Aug 22, 2023

Ok I will try to uninstall every npm packages node.js and firebase-cli and then
Refollow the steps one by one
I'll send you a feedback about it

@welligtonporto
Copy link

I updated the nodejs to the last version (18.17.1) and the firebase-tools npm install -g firebase-tools and fix it.

@joemdjossou
Copy link

It is finally working guys
Thank y'all :)

@mhjb
Copy link

mhjb commented Sep 8, 2023

removing the version of firebase cli that I installed with curl did the trick

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants