Freestila
Freestila

Reputation: 11

NPM ci copies wrong files to node_modules/@quasicomp/myOtherApp-mobile/node_modules/3rdPartyLib

I have two local npm projects - myMainApp and myOtherApp. For both, i install the requirements with npm ci from an existing package-lock.json file. myMainApp has a reference to the other app in it's package-lock.json:

"node_modules/@quasicomp/myOtherApp-mobile": {
            "version": "37.11.0",
            "license": "UNLICENSED",
            "dependencies": {
                "@angular/animations": "^18.0.2",
                "@angular/cdk": "^18.0.2",
                [......]
                "3rdPartyLib": "^11.0.0",
                "vscroll": "^1.6.1"
            },
            "resolved": "../../myOtherApp/v37.11.0/packages/mobile"
        },

Other references are resolved via npm registry. Running npm ci (tested with npm 20.11.1 and 22.11.0) on myOtherApp works, npm run build does what it should.

If i run npm ci on myMainApp however the result is strange: Under myMainApp/node_modules/@quasicomp/myOtherApp-mobile/node_modules/3rdPartyLib is a copy of myOtherApp-mobile again, package.json and everything. Running npm run buidl failes because 3rdParyLib can not be resolved.

It had worked in the past, but now i got this strange error i can not fix. I get the same if i run on a clean docker container. Does anyone has at least an idea of why npm copies the wrong files to the sub node_modules project?

I tried running npm ci on myMainApp before and after npm run build on the other app, i tried different npm versions.. Can't find any difference.

Upvotes: 1

Views: 11

Answers (0)

Related Questions