我有一个由nx生成的工作角度工作区。我正在尝试使用以下命令将角度材料添加到工作区:
ng add @angular/material然而,我每次都会得到以下错误:
The add command requires to be run in an Angular project, but a project definition could not be found.
Exception: ng exited with 1相关依赖关系如下:
"@angular-builders/custom-webpack": "11.0.0",
"@angular-devkit/build-angular": "~0.1101.3",
"@angular-eslint/eslint-plugin": "~1.1.0",
"@angular-eslint/eslint-plugin-template": "~1.1.0",
"@angular-eslint/template-parser": "~1.1.0",
"@angular/cli": "^11.1.3",
"@angular/compiler-cli": "^11.1.2",
"@angular/language-service": "^11.1.2",
"@jscutlery/semver": "^1.3.1",
"@ngneat/tailwind": "^6.0.3",
"@nrwl/cli": "11.2.10",
"@nrwl/cypress": "11.2.10",
"@nrwl/eslint-plugin-nx": "11.2.10",
"@nrwl/jest": "11.2.10",
"@nrwl/linter": "11.2.10",
"@nrwl/storybook": "^11.2.10",
"@nrwl/tao": "11.2.10",
"@nrwl/workspace": "11.2.10",
"dependencies": {
"@activejs/core": "0.2.3",
"@angular-architects/ddd": "^1.1.0",
"@angular-architects/module-federation": "^1.2.3",
"@angular/animations": "^11.1.2",
"@angular/cdk": "11.1.2",
"@angular/common": "^11.1.2",
"@angular/compiler": "^11.1.2",
"@angular/core": "^11.1.2",
"@angular/elements": "11.1.2",
"@angular/flex-layout": "11.0.0-beta.33",
"@angular/forms": "^11.1.2",
"@angular/material": "11.1.2",
"@angular/platform-browser": "^11.1.2",
"@angular/platform-browser-dynamic": "^11.1.2",
"@angular/pwa": "0.1101.3",
"@angular/router": "^11.1.2",
"@angular/service-worker": "11.1.2",我正在使用LinuxMint v20.x,谢谢。
发布于 2021-02-06 17:59:17
当我试图在一个不是angular项目的目录中运行该命令时,我重现了这个错误。确保导航到项目文件夹内,例如:~/projects/new-angular-app/,然后运行命令
https://stackoverflow.com/questions/66075325
复制相似问题