Так что я использую угловую версию 8 в Termux Android ARM.Это информация об угловой версии из Angular CLI:
$ ng version
_ _ ____ _ ___
/ \ _ __ __ _ _ _| | __ _ _ __ / ___| | |_ _|
/ △ \ | '_ \ / _` | | | | |/ _` | '__| | | | | | |
/ ___ \| | | | (_| | |_| | | (_| | | | |___| |___ | |
/_/ \_\_| |_|\__, |\__,_|_|\__,_|_| \____|_____|___|
|___/
Angular CLI: 8.0.2
Node: 12.4.0
OS: android arm
Angular: <error>
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router
Но когда я использую команду ng add
для добавления PWA и сервисного работника для моего проекта веб-сайта, она возвращается к ошибке:
$ ng add @angular/pwa --project betaleapofazzamgithubio
Workspace needs to be loaded before it is used.
Error: Workspace needs to be loaded before it is used.
at Workspace._assertLoaded (/data/data/com.termux/files/home/node_modules/@angular-devkit/core/src/experimental/workspace/workspace.js:108:19)
at Workspace.getProjectByPath (/data/data/com.termux/files/home/node_modules/@angular-devkit/core/src/experimental/workspace/workspace.js:156:14)
at getProjectByCwd (/data/data/com.termux/files/home/node_modules/@angular/cli/utilities/config.js:103:26)
at Object.getConfiguredPackageManager (/data/data/com.termux/files/home/node_modules/@angular/cli/utilities/config.js:116:25)
at Object.getPackageManager (/data/data/com.termux/files/home/node_modules/@angular/cli/utilities/package-manager.js:32:35)
at new AddCommand (/data/data/com.termux/files/home/node_modules/@angular/cli/commands/add-impl.js:25:49)
at Object.runCommand (/data/data/com.termux/files/home/node_modules/@angular/cli/models/command-runner.js:172:25)
at async default_1 (/data/data/com.termux/files/home/node_modules/@angular/cli/lib/cli/index.js:32:31)
Потому что ошибка, я использую команду ng generate
вместо ng add
.Но это тоже возвращается к ошибке.Это ошибка:
$ ng generate service-worker
Workspace needs to be loaded before it is used.
Error: Workspace needs to be loaded before it is used.
at Workspace._assertLoaded (/data/data/com.termux/files/home/node_modules/@angular-devkit/core/src/experimental/workspace/workspace.js:108:19)
at Workspace.getProjectByPath (/data/data/com.termux/files/home/node_modules/@angular-devkit/core/src/experimental/workspace/workspace.js:156:14)
at Object.getProjectByCwd (/data/data/com.termux/files/home/node_modules/@angular/cli/utilities/config.js:103:26)
at GenerateCommand.getDefaultSchematicCollection (/data/data/com.termux/files/home/node_modules/@angular/cli/models/schematic-command.js:251:38)
at GenerateCommand.parseSchematicInfo (/data/data/com.termux/files/home/node_modules/@angular/cli/commands/generate-impl.js:70:35)
at GenerateCommand.initialize (/data/data/com.termux/files/home/node_modules/@angular/cli/commands/generate-impl.js:16:54)
at GenerateCommand.validateAndRun (/data/data/com.termux/files/home/node_modules/@angular/cli/models/command.js:127:20)
at async Object.runCommand (/data/data/com.termux/files/home/node_modules/@angular/cli/models/command-runner.js:178:24)
at async default_1 (/data/data/com.termux/files/home/node_modules/@angular/cli/lib/cli/index.js:32:31)
Пожалуйста, помогите этой ошибке и исправьте эту ошибку.