2

I accidentally deleted MyProject/node_modules folder from my solution.

Is there any way to recreate this folder?

I tried npm install, npm update but no success.

shA.t
  • 16,580
  • 5
  • 54
  • 111
Raphael Lima
  • 179
  • 1
  • 14

2 Answers2

0

There is a npm package which will search through your source code and create a list of dependancies.

If you create a new package.json (use npm init) then run dependency-check in your project directory, the file will be populated. Then simply run npm install.

0

if the folder node_modules can't be created when you write npm install:

  1. rename package.json and package-lock.jsonor delete it.I recommend rename before to delete.
  2. create the empty folder node_modules
  3. create the package.json writting npm init or npm init -y
  4. try again npm install if not found try installa with a npm package example npm i fs
ErikVera
  • 1
  • 1