有问题要用angularcli.On ng build命令构建我的角度应用程序,它会显示以下错误。我错过了什么。
You have to be inside an angular-cli project in order to use the build command.一个样品很好用。然而,旧的项目有这个问题。旧项目不是由“ng新”创建的,package.json中的角-cli.json和条目是手动添加的。它构建了一段时间,并且所有兼容的版本都更改了cli、转角、rxjs和zone,现在它陷入了这个错误。
吴
angular-cli: 1.0.0-beta.28.3
node: 6.11.1
os: win32 x64
@angular/common: 2.3.1
@angular/compiler: 2.3.1
@angular/core: 2.3.1
@angular/forms: 2.3.1
@angular/http: 2.3.1
@angular/platform-browser: 2.3.1
@angular/platform-browser-dynamic: 2.3.1
@angular/router: 3.4.10
@angular/upgrade: 2.0.2
@angular/compiler-cli: 2.3.1package.json有以下条目及更多
"name": "project1",
"version": "1.0.0",
"description": "Application to capture info",
"angular-cli": {},
...
"dependencies": {
"@angular/common": "^2.3.1",
"@angular/compiler": "^2.3.1",
"@angular/core": "^2.3.1",
"@angular/forms": "^2.3.1",
"@angular/http": "^2.3.1",
"@angular/platform-browser": "^2.3.1",
"@angular/platform-browser-dynamic": "^2.3.1",
...
"devDependencies": {
"@angular/compiler-cli": "^2.3.1",和一个标准的角-cli.json
"apps": [
{
"root": ".",
"outDir": "dist",
"assets": [
"assets",
"favicon.ico"
],
"index": "index.html",
"main": "app/main.ts",发布于 2017-08-16 07:58:57
你必须在你的项目目录中。在终端窗口,做
cd YourProjectName
ng build您仍然可以看到角cli版本,因为您将其全局安装在计算机上。
https://stackoverflow.com/questions/45708088
复制相似问题