Node.js: Step by Step
Confirming the Installation
simply run node --version from the command
line, and you should see some indication that you're running the latest version
of Node which, at this time, is version 6.91. If you see a version print out
then you can rest assured that everything went swimmingly and you're ready to
write your first Node app.
node --version
Create package .json
This will initiate a
command line questionnaire that will conclude with the creation of a
package.json in the directory you initiated the command.
name: the current directory nameversion: always1.0.0description: info from the readme, else an empty string""main: alwaysindex.jsscripts: by default creates a emptytestscriptkeywords: emptyauthor: emptylicense:ISCbugs: info from the current directory, if presenthomepage: info from the current directory, if present
Install Flags
The easier (and more awesome) way to add dependencies to your
package.json is to do so from the command line, flagging the npm install command with either --save or --save-dev, depending on how you'd like to use that dependency.
To add an entry to your
package.json's dependencies:
npm install <package_names> --save 


Comments
Post a Comment