Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error: double-loading config "E:\Node\.npmrc" as "user", previously loaded as "project"

Tags:

node.js

npm

When I try to do any npm commands I get this error:

Error: double-loading config "E:\Node\.npmrc" as "user", previously loaded as "project"

But when I run npm globally with the -g param, it works. E:\Node is my global installation folder that all projects share. The output of npm -g config list is:

E:\Node>npm -g config list
; "builtin" config from E:\Node\node_modules\npm\npmrc

; prefix = "C:\\Users\\raherne\\AppData\\Roaming\\npm" ; overridden by global

; "global" config from C:\Users\raherne\AppData\Roaming\npm\etc\npmrc

cache = "E:\\Node\\npm-cache"
HOME = "E:\\Node"
prefix = "E:\\Node"
registry = "https://registry.npmjs.org/"
userconfig = "E:\\Node\\.npmrc"

; "cli" config from command line options

global = true

; node bin location = E:\Node\node.exe
; node version = v18.12.1
; npm local prefix = E:\Node
; npm version = 8.19.2
; cwd = E:\Node
; HOME = C:\Users\raherne
; Run `npm config ls -l` to show all defaults.

But I can't run things like npm-audit globally so still need to solve this issue

like image 735
rory Avatar asked Oct 18 '25 06:10

rory


1 Answers

I was able to solve this issue with a work around, I just open the file firebase.json and remove the pre conditions for build.

This is my file

{
  "firestore": {
    "rules": "firestore.rules",
    "indexes": "firestore.indexes.json"
  },
  "functions": [
    {
      "source": "functions",
      "codebase": "default",
      "ignore": [
        "node_modules",
        ".git",
        "firebase-debug.log",
        "firebase-debug.*.log"
      ]
    }
  ]
}

since I just remove those, you need to ensure npm run build is execute before the deploy, by just adding a new script in your package.json you still can achieve the same result.

{
    ...
    "deploy": "npm run build && firebase deploy --only functions",
    ...
}
like image 154
BlaShadow Avatar answered Oct 19 '25 21:10

BlaShadow