I accidently run a command in my Mern project that ' npm un dev' instead of 'npm run dev' and it delete some packages and i don't know how to recover these packages.
Asked
Active
Viewed 426 times
3 Answers
6
See npm uninstall:
aliases: remove, rm, r, un, unlink
__
npm install
should put everything back, assuming package.json wasn't modified.

isherwood
- 58,414
- 16
- 114
- 157
0
The list of packages that you deleted is still contained in the package.json file. This file is located in node_modules folder. To fix your issue, just execute the command:
npm install
or the shorter equivalent:
npm i
And those packages will be restored.
More details -> https://docs.npmjs.com/cli/v8/commands/npm-install

Dennis Kozevnikoff
- 2,078
- 3
- 19
- 29
0
run npm i interminal, this will install all packages which are listed in package.json

Jhow
- 1
- 2
-
2This is not what the op asked. He asked what the `npm un dev` command is. `npm un` is an alias for `npm uninstall`, so this answer isn't correct – Boguz Aug 24 '22 at 07:34