How Generate Nodejs Express Dependencies Package.json
As I started to develop my first nodejs express application, I added many packages with npm.
I would like to know if there is a way to generate a
package.json file containing all the current dependencies or the list of the current packages under the
npm list to see what you have installed. Run
npm shrinkwrap to build a
npm-shrinkwrap.json file, which you can use as a starting reference to build a proper
package.json. My workflow is always to update package.json and then run
npm install. I never run
npm install foo to get some package because it creates risk of forgetting to add it to
package.json and then having your application fail to start on deployment.
Updated to add: These days I do run
npm install --save foo or
npm install --save-dev foo since I have now decided the
~0.4.3 version numbers it adds to
package.json are better than my former preference for
0.4.x since the
~ gives you a more precise minimum version number.
- → Maximum call stack exceeded when instantiating class inside of a module
- → Browserify api: how to pass advanced option to script
- → Node.js Passing object from server.js to external modules?
- → gulp-rename makes copies, but does not replace
- → requiring RX.js in node.js
- → Remove an ObjectId from an array of objectId
- → Can not connect to Redis
- → React: How to publish page on server using React-starter-kit
- → Express - better pattern for passing data between middleware functions
- → Can't get plotly + node.js to stream data coming through POST requests
- → IsGenerator implementation
- → Async/Await not waiting
- → (Socket.io on nodejs) Updating div with mysql data stops without showing error