Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

node add dependency

// Option 1
// In the terminal/console of the project directory run:
npm install express // express is the name of the package

// Option 2
// Include package in the project's package.json file

{
  "name": "ApplicationName",
  "version": "0.0.1",
  "description": "Application Description",
  "main": "server.js",
  "scripts": {
    "start": "node server.js"
  },
  "repository": {
    "type": "git",
    "url": "https://github.com/npm/npm.git"
  },

  //packages go here
  "dependencies": { 
    "express": "~3.0.1",
    "sequelize": "latest",
    "q": "latest",
    "tedious": "latest",
    "angular": "latest",
    "angular-ui-router": "~0.2.11",
    "path": "latest",
    "dat-gui": "latest"
  }

}
 
PREVIOUS NEXT
Tagged: #node #add #dependency
ADD COMMENT
Topic
Name
3+2 =