I am wondering if there is a native way of install all dependencies listed in package.json from a Project A to a Project B except the way of use Python virtual env or another more "heavy" solution as use Docker image( but I think this would be overkilling).
Asked
Active
Viewed 58 times
0
-
How about installing the package? But if you only want to merge them... I don’t think so :/ – Akxe Sep 02 '19 at 22:03
-
I realized that this isn't quite possible due the fact that package.json does have also metadata like project name, licenze etc. This will collide, so even a copy and past of the dependencies would be possible. On top of that to have all the tree of dependencies it should also be copied package-lock.json – Carmine Tambascia Sep 03 '19 at 09:53
1 Answers
0
yes in the terminal in the project simply type npm i
and it will look for a package.json if it finds one it will download all the packages in it, if it doesnt find one it will ask you to create on

Bahaaaldin Mohammad
- 109
- 1
- 10
-
Are in this way going to install them globally?Should ti work doing npm i --save-dev? – Carmine Tambascia Sep 03 '19 at 08:13
-
So should I also include package-lock.json https://stackoverflow.com/questions/44297803/what-is-the-role-of-the-package-lock-json?noredirect=1&lq=1? – Carmine Tambascia Sep 03 '19 at 08:24
-
all you need is the package.json, just copy and paste it wherever you need it – Bahaaaldin Mohammad Sep 09 '19 at 04:29