Error: Module not found: Error: Package path ./module is not exported from package /node_modules/@angular/flex-layout Flex Layout
Error: Module not found: Error: Package path ./module is not exported from package /node_modules/@angular/flex-layout Flex Layout
我在SO中遇到过类似的错误,但是在安装、删除节点模块、包-lock.json任何重新安装之后,我仍然无法摆脱错误:
./src/app/app.module.ts:8:0-63 - 错误:找不到模块:错误:包路径 ./module 未从包 /Users/pabs/FreeLance/Chris/Calculator/stamp/node_modules/@[ 中导出=17=](参见 /Users/pabs/FreeLance/Chris/Calculator/stamp/node_modules/@angular/flex-layout/package.json 中的导出字段)
{
"name": "stamp",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"watch": "ng build --watch --configuration development",
"test": "ng test"
},
"private": true,
"dependencies": {
"@angular/animations": "~13.2.0",
"@angular/cdk": "^13.2.3",
"@angular/common": "~13.2.0",
"@angular/compiler": "~13.2.0",
"@angular/core": "~13.2.0",
"@angular/flex-layout": "^13.0.0-beta.38",
"@angular/forms": "~13.2.0",
"@angular/material": "^13.2.3",
"@angular/platform-browser": "~13.2.0",
"@angular/platform-browser-dynamic": "~13.2.0",
"@angular/router": "~13.2.0",
"rxjs": "^6.6.0",
"tslib": "^2.3.0",
"zone.js": "~0.11.4"
},
"devDependencies": {
"@angular-devkit/build-angular": "~13.2.3",
"@angular/cli": "~13.2.3",
"@angular/compiler-cli": "~13.2.0",
"@types/jasmine": "~3.10.0",
"@types/node": "^12.11.1",
"jasmine-core": "~4.0.0",
"karma": "~6.3.0",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage": "~2.1.0",
"karma-jasmine": "~4.0.0",
"karma-jasmine-html-reporter": "~1.7.0",
"typescript": "~4.5.2"
}
}
原来我正在使用 Visual Studio 代码执行 auto-import,它生成了错误的路径:
不正确的一个:从'@angular/flex-layout/module'导入{FlexLayoutModule};
正确的一个:而不是 import { FlexLayoutModule } from '@angular/flex-layout';
我在SO中遇到过类似的错误,但是在安装、删除节点模块、包-lock.json任何重新安装之后,我仍然无法摆脱错误:
./src/app/app.module.ts:8:0-63 - 错误:找不到模块:错误:包路径 ./module 未从包 /Users/pabs/FreeLance/Chris/Calculator/stamp/node_modules/@[ 中导出=17=](参见 /Users/pabs/FreeLance/Chris/Calculator/stamp/node_modules/@angular/flex-layout/package.json 中的导出字段)
{
"name": "stamp",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"watch": "ng build --watch --configuration development",
"test": "ng test"
},
"private": true,
"dependencies": {
"@angular/animations": "~13.2.0",
"@angular/cdk": "^13.2.3",
"@angular/common": "~13.2.0",
"@angular/compiler": "~13.2.0",
"@angular/core": "~13.2.0",
"@angular/flex-layout": "^13.0.0-beta.38",
"@angular/forms": "~13.2.0",
"@angular/material": "^13.2.3",
"@angular/platform-browser": "~13.2.0",
"@angular/platform-browser-dynamic": "~13.2.0",
"@angular/router": "~13.2.0",
"rxjs": "^6.6.0",
"tslib": "^2.3.0",
"zone.js": "~0.11.4"
},
"devDependencies": {
"@angular-devkit/build-angular": "~13.2.3",
"@angular/cli": "~13.2.3",
"@angular/compiler-cli": "~13.2.0",
"@types/jasmine": "~3.10.0",
"@types/node": "^12.11.1",
"jasmine-core": "~4.0.0",
"karma": "~6.3.0",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage": "~2.1.0",
"karma-jasmine": "~4.0.0",
"karma-jasmine-html-reporter": "~1.7.0",
"typescript": "~4.5.2"
}
}
原来我正在使用 Visual Studio 代码执行 auto-import,它生成了错误的路径:
不正确的一个:从'@angular/flex-layout/module'导入{FlexLayoutModule};
正确的一个:而不是 import { FlexLayoutModule } from '@angular/flex-layout';