簡體   English   中英

nodejs,npm腳本未運行

[英]nodejs, npm script not running

因此,我試圖使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"
  }
}

在此處輸入圖片說明

解決了,要運行具有自定義名稱的腳本(例如“ test-watch”),您必須執行npm run test-watch 不是npm test-watch

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM