Issue
As I've read in numerous sources, package.json does not affect the start up of the angular2 application or any other applications (React.js app for example).Basically, package.json just provides information (also called as metadata which help developers to know what they have in their application, some kind of summary for the entire application nodules?
Is this correct what I've written?
I've tried to erase some lines and run the application without the entire package.json and the app starts successfully.
In react we had the webpack.config.js but I'm aware that in angular this is hidden and is not meant to be modified. However I feel more comfortable when seeing a file which is connected to the app build procedure rather than the background scene doing it for me (like in angular).
Can someone please elaborate and confirm if the above thesis are all correct?
Solution
package.json file is required. It contain all the dependency(Dependency, DevDependency and peerDependency) with version for the angular project.
When you run npm install command then it will install all the node_modules listed under package.json. So you need to transfer code from one PC to other PC then no need to transfer all node_modules you just need proper package.json file and run npm install command.
Once you install all the dependency in your PC then application will start if you do any changes in this file.
Answered By - Dhaval kansagara
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.