NPM 6.4.1 strips 'main' field from package.json during install

cli
priority:low
triaged

(Rogier Schouten) #1

What I Wanted to Do

npm install <some package with a ‘main’ field in package.json that points to a .js file in a sub-directory of the package>

What Happened Instead

the package gets installed but there is no ‘main’ field in package.json

Reproduction Steps

npm install <some package with a ‘main’ field in package.json that points to a .js file in a sub-directory of the package>

Details

Note that npm version 6.3.0 and 6.1.0 work fine, so this is introduced somewhere after 6.3.0.

We use the Verdaccio NPM registry so maybe there is something about that.

Platform Info

$ npm --versions
6.4.1
$ node -p process.platform
win32

(Lars Willighagen) #2

I can’t reproduce this with packages from either the main npm registry or a local Verdaccio (v3.8.1) instance on npm v6.4.1 and both Windows and Linux.


(Kat Marchán) #3

This would indeed need more information. Can you come up with more specific repro steps? I suggest coming up with a git repo that can be cloned so I can see what you’re doing.