无法解析类型实体i20.cdkscrollablemodule到符号NX Workspace
所以我在网上研究了此类问题,但仍然没有找到解决方案。
我尝试删除node_module,删除package-lock.json,更新所有依赖项,甚至执行nx migrate。
我在工作区项目中看到和搜索的没有两个 node_modules
npm install 工作成功,但是一旦我运行 nxserve 命令,我会收到以下错误:
./apps/app name/src/main.ts - 错误:模块构建失败(来自./node_modules/@ngtools/webpack/src/ivy/index.js): 错误:无法将类型实体 i20.CdkScrollableModule 解析为符号 在 \node_modules@ngtools\webpack\src\ivy\loader.js:77:18 在 processTicksAndRejections (internal/process/task_queues.js:93:5)
./apps/app name/src/polyfills.ts - 错误:模块构建失败(来自 ./node_modules/@ngtools/webpack /src/ivy/index.js): 错误:无法将类型实体 i20.CdkScrollableModule 解析为符号 在 \node_modules@ngtools\webpack\src\ivy\loader.js:77:18 在 processTicksAndRejections (internal/process/task_queues.js:93:5)
Package.json:
{
"name": "nx-test",
"version": "0.0.0",
"license": "MIT",
"scripts": {
"ng": "nx",
"postinstall": "node ./decorate-angular-cli.js && ngcc --properties es2015 browser
module main",
"start": "nx serve",
"build": "nx build",
"test": "nx test"
},
"private": true,
"dependencies": {
"@angular/animations": "~13.2.0",
"@angular/common": "~13.2.0",
"@angular/compiler": "~13.2.0",
"@angular/core": "~13.2.0",
"@angular/forms": "~13.2.0",
"@angular/localize": "~13.2.0",
"@angular/material": "^13.3.2",
"@angular/platform-browser": "~13.2.0",
"@angular/platform-browser-dynamic": "~13.2.0",
"@angular/router": "~13.2.0",
"@ngx-translate/core": "^14.0.0",
"@ngx-translate/http-loader": "^7.0.0",
"@nrwl/angular": "13.9.6",
"angular-material": "^1.2.4",
"bootstrap": "^5.1.3",
"ng-packagr": "^13.3.0",
"rxjs": "~7.4.0",
"tslib": "^2.0.0",
"zone.js": "~0.11.4"
},
"devDependencies": {
"@angular-devkit/build-angular": "~13.2.0",
"@angular-eslint/eslint-plugin": "~13.0.1",
"@angular-eslint/eslint-plugin-template": "~13.0.1",
"@angular-eslint/template-parser": "~13.0.1",
"@angular/cli": "~13.2.0",
"@angular/compiler-cli": "~13.2.0",
"@angular/language-service": "~13.2.0",
"@nrwl/cli": "13.9.6",
"@nrwl/cypress": "13.9.6",
"@nrwl/eslint-plugin-nx": "13.9.6",
"@nrwl/jest": "13.9.6",
"@nrwl/linter": "13.9.6",
"@nrwl/workspace": "13.9.6",
"@types/jest": "27.0.2",
"@types/node": "16.11.7",
"@typescript-eslint/eslint-plugin": "~5.10.0",
"@typescript-eslint/parser": "~5.10.0",
"cypress": "^9.1.0",
"eslint": "~8.7.0",
"eslint-config-prettier": "8.1.0",
"eslint-plugin-cypress": "^2.10.3",
"jest": "27.2.3",
"jest-preset-angular": "11.1.1",
"nx": "13.9.6",
"postcss": "^8.4.5",
"postcss-import": "^14.0.2",
"postcss-preset-env": "^6.7.0",
"postcss-url": "^10.1.1",
"prettier": "^2.5.1",
"ts-jest": "27.0.5",
"typescript": "~4.5.2"
}
}
So I have reserached over the internet about this type of issue and still found no solution.
I have tried to delete node_module, deleted package-lock.json, updated all dependecies and even executed nx migrate.
There is no two node_modules what I have seen and search for in my workspace project
npm install works successfully but once I run nx serve command I get this following error:
./apps/app name/src/main.ts - Error: Module build failed (from ./node_modules/@ngtools/webpack/src/ivy/index.js):
Error: Cannot resolve type entity i20.CdkScrollableModule to symbol
at \node_modules@ngtools\webpack\src\ivy\loader.js:77:18
at processTicksAndRejections (internal/process/task_queues.js:93:5)
./apps/app name/src/polyfills.ts - Error: Module build failed (from ./node_modules/@ngtools/webpack/src/ivy/index.js):
Error: Cannot resolve type entity i20.CdkScrollableModule to symbol
at \node_modules@ngtools\webpack\src\ivy\loader.js:77:18
at processTicksAndRejections (internal/process/task_queues.js:93:5)
Package.json:
{
"name": "nx-test",
"version": "0.0.0",
"license": "MIT",
"scripts": {
"ng": "nx",
"postinstall": "node ./decorate-angular-cli.js && ngcc --properties es2015 browser
module main",
"start": "nx serve",
"build": "nx build",
"test": "nx test"
},
"private": true,
"dependencies": {
"@angular/animations": "~13.2.0",
"@angular/common": "~13.2.0",
"@angular/compiler": "~13.2.0",
"@angular/core": "~13.2.0",
"@angular/forms": "~13.2.0",
"@angular/localize": "~13.2.0",
"@angular/material": "^13.3.2",
"@angular/platform-browser": "~13.2.0",
"@angular/platform-browser-dynamic": "~13.2.0",
"@angular/router": "~13.2.0",
"@ngx-translate/core": "^14.0.0",
"@ngx-translate/http-loader": "^7.0.0",
"@nrwl/angular": "13.9.6",
"angular-material": "^1.2.4",
"bootstrap": "^5.1.3",
"ng-packagr": "^13.3.0",
"rxjs": "~7.4.0",
"tslib": "^2.0.0",
"zone.js": "~0.11.4"
},
"devDependencies": {
"@angular-devkit/build-angular": "~13.2.0",
"@angular-eslint/eslint-plugin": "~13.0.1",
"@angular-eslint/eslint-plugin-template": "~13.0.1",
"@angular-eslint/template-parser": "~13.0.1",
"@angular/cli": "~13.2.0",
"@angular/compiler-cli": "~13.2.0",
"@angular/language-service": "~13.2.0",
"@nrwl/cli": "13.9.6",
"@nrwl/cypress": "13.9.6",
"@nrwl/eslint-plugin-nx": "13.9.6",
"@nrwl/jest": "13.9.6",
"@nrwl/linter": "13.9.6",
"@nrwl/workspace": "13.9.6",
"@types/jest": "27.0.2",
"@types/node": "16.11.7",
"@typescript-eslint/eslint-plugin": "~5.10.0",
"@typescript-eslint/parser": "~5.10.0",
"cypress": "^9.1.0",
"eslint": "~8.7.0",
"eslint-config-prettier": "8.1.0",
"eslint-plugin-cypress": "^2.10.3",
"jest": "27.2.3",
"jest-preset-angular": "11.1.1",
"nx": "13.9.6",
"postcss": "^8.4.5",
"postcss-import": "^14.0.2",
"postcss-preset-env": "^6.7.0",
"postcss-url": "^10.1.1",
"prettier": "^2.5.1",
"ts-jest": "27.0.5",
"typescript": "~4.5.2"
}
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我在NX工作区中收到了类似的错误,其中有Angular 14:
我发现唯一帮助的是更新到最新版本的Angular 。
我确实找到了博客文章建议您要做的只是更新 @angular/core和 @angular/cli;但是,我认为是否要更新,我将仅将所有内容更新为Angular 14的最高版本。
I received a similar error in Nx workspaces with Angular 14:
The only thing that I found that helped was updating to the latest version of Angular.
I did find a blog post that suggested that all you needed to do was update @angular/core and @angular/cli; however, I figured if I'm going to update, I'll just updating everything to highest version of Angular 14.