试图同时运行nodemon

时间:2018-01-05 05:55:25

标签: node.js npm nodemon

嘿,我试图运行nodemon来执行命令npm start,它同时使用命令打开3个nodejs进程

这是我的package.json

    {
  "name": "web",
  "version": "1.0.0",
  "description": "Classic website",
  "main": "index.js",
  "scripts": {    
    "site": "node site/index.js",
    "socket": "node socket/index.js",
    "bots": "node bots/index.js",
    "start": "concurrent \"npm run site\" \"npm run socket\" \"npm run bots\" "
  },
  "keywords": [
    "gsa",
    "web"
  ],
  "author": "sas",
  "license": "ISC",
  "dependencies": {
    "child_process": "^1.0.2",
    "concurrently": "^3.5.1",
    "express": "^4.16.2",
    "express-handlebars": "^3.0.0"
  }
}

然而,当我运行nodemon时,我收到错误 -

  

错误:找不到模块' D:\ skindole \ index.js'

2 个答案:

答案 0 :(得分:2)

运行nodemon时,您输入了什么命令?我想也许如果你从package.json中删除"main": "index.js",,你可能会成功。

我认为您要做的是在每个网站,套接字和漫游器的启动脚本中将node替换为nodemon

答案 1 :(得分:0)

尝试使用&&而不是并发?

"start": "npm run site && npm run socket && npm run bots"