gpt4 book ai didi

node.js - Angular 2 : concurrent is not recognized as internal or external command

转载 作者:太空狗 更新时间:2023-10-29 17:23:00 28 4
gpt4 key购买 nike

当使用 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"
}
}

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

最佳答案

concurrent is not recognized as internal or external command

自从添加了 "concurrently": "^1.0.0" 依赖项后,您可能还没有运行 npm install

live-server is not recognized as external or internal command

您正在安装 lite-server:

"lite-server": "^1.3.1"

然而你正在调用live-server:

“服务”:“./node_modules/.bin/live-server --host=localhost --port=3000 。”

改为调用 lite-server

关于node.js - Angular 2 : concurrent is not recognized as internal or external command,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34831781/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com