无法在linux中运行nodejs项目

时间:2018-04-28 10:01:17

标签: javascript node.js

根据文档,其运行命令为sudo start filename(filename.js)

但是当我运行这个命令时,我得到了

start: Unknown job: filename

这是我的 filename.js

var listen = require('./')
var im = require('../im')
var passTransit = require('../passTransit')
var textConnect = require('../textConnect')

function repeat (d) {
  function next () {
    setTimeout(function () {d(next)}, 60000)
  }
  next()
}

var httpServer = listen({name: 'server', port: 3080})
im.listen(httpServer)
passTransit.busEmulator()

repeat(textConnect.closeExpiredChat)
repeat(textConnect.sendAppointmentReminder)

关联的 package.json

{
  "name": "passtest",
  "version": "3.8.0",
  "description": "test  pass",
  "dependencies": {
    "@google-cloud/bigquery": "0.6.0",
    "async": "2.1.4",
    "aws-sdk": "2.149.0",
    "binary": "0.3.0",
    "body-parser": "1.15.2",
    "bootstrap": "3.3.7",
    "bootstrap-social": "5.1.1",
    "browserify": "14.5.0",
    "clean-css": "4.1.7",
    "compression": "1.6.2",
    "cookie": "0.3.1",
    "cookie-parser": "1.4.3",
    "cssify": "1.0.3",
    "d3": "4.4.0",
    "db3": "2.2.3",
    "db3-config": "1.3.0",
    "decamelize": "1.2.0",
    "diskusage": "0.1.5",
    "email-validator": "1.0.7",
    "ent": "2.2.0",
    "eonasdan-bootstrap-datetimepicker": "4.17.47",
    "escape-string-regexp": "1.0.5",
    "express": "4.14.0",
    "factor-bundle": "2.5.0",
    "fast-csv": "2.3.0",
    "filesize": "3.5.11",
    "font-awesome": "4.7.0",
    "form-serializer": "2.5.0",
    "geolib": "2.0.22",
    "github": "7.1.0",
    "hsts": "2.0.0",
    "http-proxy": "1.16.2",
    "is-stream": "1.1.0",
    "jquery": "3.1.1",
    "jquery-ui": "1.12.1",
    "mailparser": "0.6.1",
    "moment": "2.17.1",
    "moment-timezone": "0.5.13",
    "morgan": "1.7.0",
    "multer": "1.2.1",
    "nodemailer": "2.7.0",
    "nodemailer-sendmail-transport": "1.0.0",
    "page": "1.7.1",
    "passport": "0.3.2",
    "passport-facebook": "2.1.1",
    "passport-github": "1.1.0",
    "passport-google-oauth20": "1.0.0",
    "password-generator": "2.1.0",
    "plur": "2.1.2",
    "prompt": "1.0.0",
    "puppeteer": "0.10.2",
    "qs": "6.3.0",
    "serve-favicon": "2.3.2",
    "sharp": "0.18.2",
    "shell-escape": "0.2.0",
    "soap": "0.18.0",
    "socket.io": "1.7.2",
    "socket.io-client": "1.7.2",
    "striptags": "2.1.1",
    "superagent": "3.3.1",
    "typeahead.js": "0.11.1",
    "uglify-js": "3.0.25",
    "uid-number": "0.0.6",
    "underscore": "1.8.3",
    "watchify": "3.9.0",
    "ws": "1.1.1",
    "yauzl": "2.8.0",
    "yazl": "2.4.2",
    "zoho-cloud-sql": "1.2.2",
    "zoho-reports": "1.1.2"
  },
  "private": true,
  "devDependencies": {
    "eslint": "4.10.0",
    "eslint-plugin-json": "1.2.0",
    "faker": "3.1.0",
    "jsdom": "11.3.0",
    "mocha": "3.4.2"
  },
  "engines": {
    "node": "6.12.2"
  },
  "scripts": {
    "start": "sudo start filename1; sudo start filename3; sudo start filename2",
    "stop": "sudo stop filename2; sudo stop filename1; sudo stop filename3",
    "restart": "npm i && node db/sync && node browserify | cat && sudo restart filename2 && sudo restart filename1 && sudo restart filename3",
    "disable": "sudo rm /etc/init/filename2.conf; sudo rm /etc/init/filename1.conf; sudo rm /etc/init/filename3.conf",
    "enable": "sudo cp etc/init/filename2.conf /etc/init/; sudo cp etc/init/filename1.conf /etc/init/; sudo cp etc/init/filename3.conf /etc/init/"
  }
}

请帮助

0 个答案:

没有答案