简体   繁体   中英

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

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM