代码之家  ›  专栏  ›  技术社区  ›  Sal

不角度.json从4级升级到7级时

  •  1
  • Sal  · 技术社区  · 6 年前

    我遵循上面提到的所有步骤 here 将我的基本应用程序从4升级到7,但无论我做了什么,我都无法创建一个角度.json文件。跑步 ng update @angular/cli 不管我跑了多少次都没用。

    我想我可以试着用 ng new test-app

    有人知道我是怎么产生的吗角度.json自动地?

    这是我的包.json:

    "dependencies": {
        "@angular/animations": "^7.0.2",
        "@angular/cli": "^7.0.4",
        "@angular/common": "^7.0.2",
        "@angular/compiler": "^7.0.2",
        "@angular/core": "^7.0.2",
        "@angular/forms": "^7.0.2",
        "@angular/http": "^7.0.2",
        "@angular/platform-browser": "^7.0.2",
        "@angular/platform-browser-dynamic": "^7.0.2",
        "@angular/router": "^7.0.2",
        "@ng-bootstrap/ng-bootstrap": "^4.0.0",
        "angular-crumbs": "^3.0.1",
        "angular2-csv": "^0.2.5",
        "core-js": "^2.5.7",
        "ng2-filter-pipe": "^0.1.10",
        "ngx-clipboard": "^11.1.9",
        "ngx-pagination": "^3.2.1",
        "ngx-window-token": "^1.0.2",
        "rxjs": "6.3.3",
        "systemjs": "0.19.40",
        "zone.js": "^0.8.26"
      }
    

    map: {
        // our app is within the app folder
        'app': 'app',
    
        // angular bundles
        '@angular/core': 'npm:@angular/core/bundles/core.umd.js',
        '@angular/common': 'npm:@angular/common/bundles/common.umd.js',
        '@angular/compiler': 'npm:@angular/compiler/bundles/compiler.umd.js',
        '@angular/animations': 'npm:@angular/animations/bundles/animations.umd.min.js',
        '@angular/animations/browser': 'npm:@angular/animations/bundles/animations-browser.umd.js',
        '@angular/platform-browser': 'npm:@angular/platform-browser/bundles/platform-browser.umd.js',
        '@angular/platform-browser/animations': 'npm:@angular/platform-browser/bundles/platform-browser-animations.umd.js',
        '@angular/platform-browser-dynamic': 'npm:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.js',
        '@angular/http': 'npm:@angular/http/bundles/http.umd.js',
        '@angular/router': 'npm:@angular/router/bundles/router.umd.js',
        '@angular/forms': 'npm:@angular/forms/bundles/forms.umd.js',
    
        // other libraries
        'ngx-window-token': 'npm:ngx-window-token/bundles/ngx-window-token.umd.min.js',
        'rxjs': 'npm:rxjs',
        'angular-crumbs': 'npm:angular-crumbs/bundles/angular-crumbs.umd.min.js',
        '@ng-bootstrap/ng-bootstrap': 'npm:@ng-bootstrap/ng-bootstrap/bundles/ng-bootstrap.umd.min.js',
        'ng2-filter-pipe': 'npm:ng2-filter-pipe/dist/index.js',
        'ngx-pagination': 'npm:ngx-pagination/dist/ngx-pagination.umd.js',
        'ngx-clipboard': 'npm:ngx-clipboard/bundles/ngx-clipboard.umd.min.js',
        'angular2-csv': 'npm:angular2-csv/Angular2-csv.js'
    },
    // packages tells the System loader how to load when no filename and/or no extension
    packages: {
        app: {
            defaultExtension: 'js',
            meta: {
                './*.js': {
                    loader: 'systemjs-angular-loader.js'
                }
            }
        },
        rxjs: {
            main: 'index.js',
            defaultExtension: 'js'
        },
        'rxjs/operators': {
            main: 'index.js',
            defaultExtension: 'js'
        }
    }
    

    ng更新@angular/cli :

    C:\MyProject>ng update @angular/cli
    UPDATE package.json (2265 bytes)
    npm WARN angular-crumbs@3.0.1 requires a peer of @angular/common@>=2.0.0 <7.0.0 but none is installed. You must install peer dependencies yourself.
    npm WARN angular-crumbs@3.0.1 requires a peer of @angular/core@>=2.0.0 <7.0.0 but none is installed. You must install peer dependencies yourself.
    npm WARN angular-crumbs@3.0.1 requires a peer of @angular/platform-browser@>=2.0.0 <7.0.0 but none is installed. You must install peer dependencies yourself.
    npm WARN angular-crumbs@3.0.1 requires a peer of @angular/router@>=2.0.0 <7.0.0 but none is installed. You must install peer dependencies yourself.
    npm WARN angular-crumbs@3.0.1 requires a peer of reflect-metadata@^0.1.8 but none is installed. You must install peer dependencies yourself.
    npm WARN angular2-csv@0.2.5 requires a peer of @angular/core@^2.0.0||^4.0.0 but none is installed. You must install peer dependencies yourself.
    npm WARN angular2-csv@0.2.5 requires a peer of @angular/http@^2.0.0||^4.0.0 but none is installed. You must install peer dependencies yourself.
    npm WARN angular2-csv@0.2.5 requires a peer of rxjs@^5.0.0 but none is installed. You must install peer dependencies yourself.
    npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules\fsevents):
    npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
    npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules\@angular-devkit\core\node_modules\fsevents):
    npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
    

    谢谢。

    0 回复  |  直到 6 年前