5

I've gone through similar errors in SO but after installing, deleting node-modules, package-lock.json any installing it again, I still can't get rid of the error:

./src/app/app.module.ts:8:0-63 - Error: Module not found: Error: Package path ./module is not exported from package /Users/pabs/FreeLance/Chris/Calculator/stamp/node_modules/@angular/flex-layout (see exports field in /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"
  }
}
Pablo Aguirre de Souza
  • 3,939
  • 4
  • 14
  • 30
  • 1
    I think you are incorrectly import flex- layout this post may help you https://stackoverflow.com/questions/70445014/module-not-found-error-package-path-is-not-exported-from-package – abdella Feb 20 '22 at 08:40
  • 1
    Does this answer your question? [Module not found: Error: Package path . is not exported from package](https://stackoverflow.com/questions/70445014/module-not-found-error-package-path-is-not-exported-from-package) – abdella Feb 20 '22 at 08:51

1 Answers1

20

Turns out I was doing an auto-import using Visual Studio Code and it generates the wrong path :

incorrect one: import { FlexLayoutModule } from '@angular/flex-layout/module';

correct one: instead of import { FlexLayoutModule } from '@angular/flex-layout';

Pablo Aguirre de Souza
  • 3,939
  • 4
  • 14
  • 30