Angular 角度2:quot;的错误;“开始”:&引用;贸易及供应链&;同时……”;
在package.json中,我有:Angular 角度2:quot;的错误;“开始”:&引用;贸易及供应链&;同时……”;,angular,npm,Angular,Npm,在package.json中,我有: "scripts": { "start": "tsc && concurrently \"npm run tsc:w\" \"npm run lite\"", ... } 当我通过“npm start”运行它时,我得到错误: npm错误!失败Angular2Try@1.0.0启动脚本“tsc”&& 同时“npm运行tsc:w”“npm运行lite”。 npm错误!确保你 安装最新版本的node.js和npm。 npm错误!如果
"scripts": {
"start": "tsc && concurrently \"npm run tsc:w\" \"npm run lite\"",
...
}
当我通过“npm start”运行它时,我得到错误:
npm错误!失败Angular2Try@1.0.0启动脚本“tsc”&&
同时“npm运行tsc:w”“npm运行lite”。
npm错误!确保你
安装最新版本的node.js和npm。
npm错误!如果你
是的,这很可能是Angular2Try包的问题
npm错误!与npm本身无关
我有最新版本的nodejs(v7.5.0)和npm(v4.1.2),所以我认为这不是问题所在
顺便说一下,当我将其更改为:
"start": "concurrently \"npm run tsc:w\" \"npm run lite\"",
有效:)这可能无法准确回答您的问题,但我想分享我在package.json脚本文件中为几个angular 2应用程序编写的内容,并对您的分辨率进行推测- *我的结论是建议在脚本中省略“npm运行”。开始字符串 它看起来像是“tsc&&;同时”tsc-w“lite服务器”, 我的应用程序正在使用文件中的默认脚本 在正确的目录中,我在控制台中键入“npm start” 我的scripts.start行的区别在于没有“npm run”关键字 下面是my package.json显示的内容:
"scripts" {
"start": "tsc && concurrently \"tsc -w\" \"lite-server\" ",
在另一个项目中,我按照一些指南构建package.json文件。我键入“npm运行应用程序”以利用脚本
最后我在scripts.start中使用了以下代码:
"scripts" {
"tsc": "tsc",
"tsc:w": "tsc -w",
"lite": "lite-server",
"app": "concurrent \"npm run tsc:w\" \"npm run lite\" ",
我也做到了这一点:
{
"name": "ng2-start",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"start": "concurrent \"npm run tsc:w\" \"npm run lite\" ",
"lite": "lite-server",
"test": "echo \"Error: no test specified\" && exit 1",
"tsc": "tsc",
"tsc:w": "tsc -w",
"typings": "typings",
"postinstall": "typing install"
},