Packages that are in devDependencies AND optionalDependencies are automatically added to package.json's dependencies on npm install.
npm install shouldn't edit the package.json.
npm v6 docs states that Entries in optionalDependencies will override entries of the same name in dependencies, so it鈥檚 usually best to only put in one place. (https://docs.npmjs.com/files/package.json#optionaldependencies)
npm init -ynpm install noop --save-optionalnpm installdependencies.I am noticing this same issue on npm 7.0.6, except it happens for packages with are only in optionalDependencies.
Most helpful comment
I am noticing this same issue on npm 7.0.6, except it happens for packages with are only in
optionalDependencies.