I am very curious about it , but don't know how can it know where to insert or delete package name ?
Asked
Active
Viewed 48 times
-1
-
2You can always read the source code on https://github.com/npm/cli and clarify what you want to know. – dereli Aug 16 '18 at 14:00
1 Answers
0
Try this to auto insert latest version in package.json
npm install --save xx

obba
- 77
- 3
-
Since `npm@5.0.0` running `npm install
` (without the `--save` flag) by default adds the package to the `dependencies` section of _package.json_ - unless `npm config set save false` has been set of course. The [docs](https://docs.npmjs.com/cli/install) no longer include the `--save` flag as it's redundant. However, the `--save` flag is available when running [`npm uninstall – RobC Aug 16 '18 at 14:17`](https://docs.npmjs.com/cli/uninstall) if you want to remove from _package.json_.