what is 'npm un dev' as i accidently run in my terminal?

Viewed 38

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.

3 Answers

See npm uninstall:

aliases: remove, rm, r, un, unlink
                        __

npm install should put everything back, assuming package.json wasn't modified.

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

run npm i interminal, this will install all packages which are listed in package.json

Related