简体   繁体   English

nodejs,npm脚本未运行

[英]nodejs, npm script not running

So I'm attempting to get npm test-watch working, so it auto restarts my script, though, for some reason it's not finding the command 因此,我试图使npm test-watch正常工作,因此它会自动重新启动脚本,但是由于某种原因,它找不到命令

{
  "name": "node-test",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "mocha **/*.test.js",
    "test-watch": "nodemon --exec \"npm test\"" ------ this
  },
  "author": "",
  "license": "ISC",
  "devDependencies": {
    "mocha": "^3.0.0"
  },
  "dependencies": {
    "robotjs": "^0.5.1"
  }
}

在此处输入图片说明

Solved, to run a script with a custom name (like "test-watch"), you have to do npm run test-watch . 解决了,要运行具有自定义名称的脚本(例如“ test-watch”),您必须执行npm run test-watch not npm test-watch 不是npm test-watch

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM