Я выполнил все шаги, упомянутые здесь , чтобы обновить приложение Basic с 4 до 7, но, что бы я ни делал, я не смог создать файл angular.json. Запуск ng update @angular/cli
не помог, независимо от того, сколько раз я его запускал.
Я предполагаю, что проблема в том, что руководство предполагает, что у меня уже есть angular-cli.json, но в Angular 4 в то время не было Angular CLI, поэтому у меня уже нет файла angular-cli.json.
Я подумал, что мог бы попытаться создать новое приложение, используя ng new test-app
и скопировать файл angular.json в мой, но мне нужно настроить множество параметров, что означает, что в этом методе достаточно места для ошибок. .
Кто-нибудь знает, как я могу автоматически генерировать angular.json?
Я уже обновил все свои пакеты (кроме system.js) до последних версий, и мое приложение работает нормально. Но мне нужен angular.json для публикации приложения с помощью CLI.
Вот мой package.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"
}
И мой конфигурационный файл SystemJS:
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 update @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"})
Спасибо.