1
votes

As per title, I have been developing my react app in a very bad manner.

Since I worked in an offline environment, whenever I needed to install a new package top be used in my application, I would manually copy it into my node_modules folder. The problem is that I normally do not update my package.json file with the newly installed dependency.

Because of this, after a long time, my node_modules folder grew quite large (300 ish).

When I send the application to my colleauge to develop and he ran npm install "some package", npm deletes more than half of my manually installed packages (ouch). (Also this explains npm's behavior on this https://github.com/npm/npm/issues/17929#issuecomment-322881421 )

Is there a way for me to update my package.json file with all of my dependencies manually installed in my node_modules folder? Besides having to manually type all 300 plus modules (+ modules that are downloaded as it is a dependancy of another node_module)?

Im pretty desperate so any advice will really be appreciated.

1

1 Answers

0
votes

You could try deleting your package-lock.json, run npm shrinkwrap, and then paste the dependencies in the generated npm-shrinkwrap.json into your package.json. This will be way more verbose than your package.json would normally be, because I think it will explicitly list the dependencies of all your dependencies (like package-lock.json), but it should give you a file that your application can be installed from by a colleague.