如何在npm开始之前使用Nodejs

时间:2016-11-14 08:13:29

标签: node.js npm

我试图在运行我的应用之前从git中提取文件,我正在使用git pull && node ./bin/www并且应用程序挂起。我是Nodejs的新手。是否有另一种方式呢?

{
  "name": "matcha",
  "version": "0.0.0",
  "private": true,
  "scripts": {
  "start": "git pull && node ./bin/www"
},
  "dependencies": {
  "base-64": "^0.1.0",
  "bcryptjs": "^2.3.0",
  "body-parser": "~1.15.2",
  "cookie-parser": "~1.4.3",
  "crypto": "0.0.3",
  "debug": "~2.2.0",
  "ejs": "~2.5.2",
  "express": "~4.14.0",
  "express-session": "^1.14.2",
  "fs": "0.0.1-security",
  "morgan": "~1.7.0",
  "multer": "^1.2.0",
  "mysql": "^2.12.0",
  "nodemailer": "^2.6.4",
  "path": "^0.12.7",
  "serve-favicon": "~2.3.0"
},
  "repository": {
  "type": "git",
  "url": "https://github.com/julekgwa/Matcha.git"
  }
}

enter image description here

1 个答案:

答案 0 :(得分:2)

您可以使用Anonymous Type

更新依赖项时,需要运行prestart。所以脚本示例是:

npm install