Angular2:并发不被识别为内部或外部命令

bla*_*awk 6 webserver development-environment node.js typescript angular

使用npm start运行angular2的服务器时会发出错误,即并发不被识别为内部或外部命令,为什么会发生这种错误

这是package.json:

{
  "name": "contactlistapp",
  "version": "1.0.0",
  "description": "The app",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "tsc": "./node_modules/.bin/tsc",
    "tsc:w": "./node_modules/.bin/tsc -w",
    "serve": "./node_modules/.bin/live-server --host=localhost --port=3000 .",
    "start": "concurrent \"npm run tsc:w\" \"npm run serve\" "
  },
  "author": "Sarah",
  "license": "ISC",
  "dependencies": {
    "express": "^4.13.3",
    "angular2": "2.0.0-beta.0",
    "systemjs": "0.19.6",
    "es6-promise": "^3.0.2",
    "es6-shim": "^0.33.3",
    "reflect-metadata": "0.1.2",
    "rxjs": "5.0.0-beta.0",
    "zone.js": "0.5.10"
  },
  "devDependencies": {
    "concurrently": "^1.0.0",
    "lite-server": "^1.3.1",
    "typescript": "^1.7.3"
  }
}
Run Code Online (Sandbox Code Playgroud)

项目的结构是有node_module和typings文件夹,有app.ts文件用于服务器(空只表示已导入)和component.ts(及其.js),tsconfig.json

Lan*_*ley 13

并发不被识别为内部或外部命令

npm install由于您添加了"concurrently": "^1.0.0"依赖项,因此您可能还没有运行.

live-server不被识别为外部或内部命令

您正在安装lite-server:

"lite-server": "^1.3.1"

你打电话给live-server:

"serve": "./node_modules/.bin/live-server --host=localhost --port=3000 ."

打电话lite-server来.