1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

ng serve error: You seem to not be depending on "@angular/core"

Discussão em 'Angular' iniciado por user022yufjb, Junho 24, 2025.

  1. user022yufjb

    user022yufjb Guest

    I keep getting the error You seem to not be depending on "@angular/core" I have tried everything on the stackoverflow it says from using npm install, npm link to everything. Does anyone know how to solve the error? [​IMG]

    try installing @angular/core but gets this error

    C:\xampp\htdocs\kindyportalBackend>npm install @angular/core
    npm ERR! code ERESOLVE
    npm ERR! ERESOLVE could not resolve
    npm ERR!
    npm ERR! While resolving: @angular-devkit/build-angular@16.2.0
    npm ERR! Found: jest@26.6.3
    npm ERR! node_modules/jest
    npm ERR! peer jest@">=26 <27" from ts-jest@26.5.6
    npm ERR! node_modules/ts-jest
    npm ERR! dev ts-jest@"^26.5.2" from the root project
    npm ERR! dev jest@"^26.6.3" from the root project
    npm ERR!
    npm ERR! Could not resolve dependency:
    npm ERR! peerOptional jest@"^29.5.0" from @angular-devkit/build-angular@16.2.0
    npm ERR! node_modules/@angular-devkit/build-angular
    npm ERR! dev @angular-devkit/build-angular@"^16.2.0" from the root project
    npm ERR!
    npm ERR! Conflicting peer dependency: jest@29.6.4
    npm ERR! node_modules/jest
    npm ERR! peerOptional jest@"^29.5.0" from @angular-devkit/build-angular@16.2.0
    npm ERR! node_modules/@angular-devkit/build-angular
    npm ERR! dev @angular-devkit/build-angular@"^16.2.0" from the root project
    npm ERR!
    npm ERR! Fix the upstream dependency conflict, or retry
    npm ERR! this command with --force or --legacy-peer-deps
    npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
    npm ERR!
    npm ERR!
    npm ERR! For a full report see:
    npm ERR! C:\Users\hemlata.mahaur\AppData\Local\npm-cache\_logs\2023-08-30T23_17_40_449Z-eresolve-report.txt

    npm ERR! A complete log of this run can be found in: C:\Users\hemlata.mahaur\AppData\Local\npm-cache\_logs\2023-08-30T23_17_40_449Z-debug-0.log


    After using --force it works and I can install @angular/core. Now if I run ng serve I get this error

    An unhandled exception occurred: error TS500: Error: ENOENT: no such file or directory, lstat 'C:/xampp/htdocs/kindyportalBackend/src/tsconfig.app.json'
    at Object.lstatSync (node:fs:1668:3)
    at NodeJSFileSystem.lstat (file:///C:/xampp/htdocs/kindyportalBackend/node_modules/@angular/compiler-cli/bundles/chunk-TBUSSXUA.js:341:16)
    at calcProjectFileAndBasePath (file:///C:/xampp/htdocs/kindyportalBackend/node_modules/@angular/compiler-cli/bundles/chunk-6SPHWESC.js:7650:29)
    at readConfiguration (file:///C:/xampp/htdocs/kindyportalBackend/node_modules/@angular/compiler-cli/bundles/chunk-6SPHWESC.js:7676:39)
    at readTsconfig (C:\xampp\htdocs\kindyportalBackend\node_modules\@angular-devkit\build-angular\src\utils\read-tsconfig.js:49:26)
    at async configureI18nBuild (C:\xampp\htdocs\kindyportalBackend\node_modules\@angular-devkit\build-angular\src\utils\i18n-options.js:125:22)
    at async generateI18nBrowserWebpackConfigFromContext (C:\xampp\htdocs\kindyportalBackend\node_modules\@angular-devkit\build-angular\src\utils\webpack-browser-config.js:66:36)
    at async setup (C:\xampp\htdocs\kindyportalBackend\node_modules\@angular-devkit\build-angular\src\builders\dev-server\webpack-server.js:96:34)

    See "C:\Users\HEMLAT~1.MAH\AppData\Local\Temp\ng-1nlzeP\angular-errors.log" for further details.


    what file is that and how can I install it? I copy pasted this file [​IMG]

    Is it the right file?

    I am running this in backend project folder or do I need to run ng serve in front end project?

    After adding that file I ran ng serve and gets this error

    BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
    This is no longer the case. Verify if you need this module and configure a polyfill for it.

    If you want to include a polyfill, you need to:
    - add a fallback 'resolve.fallback: { "url": require.resolve("url/") }'
    - install 'url'
    If you don't want to include a polyfill, you can use an empty module like this:
    resolve.fallback: { "url": false }

    ./node_modules/nodemailer/lib/fetch/index.js:6:13-28 - Error: Module not found: Error: Can't resolve 'zlib' in 'C:\xampp\htdocs\kindyportalBackend\node_modules\nodemailer\lib\fetch'

    BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
    This is no longer the case. Verify if you need this module and configure a polyfill for it.

    If you want to include a polyfill, you need to:
    - add a fallback 'resolve.fallback: { "zlib": require.resolve("browserify-zlib") }'
    - install 'browserify-zlib'
    If you don't want to include a polyfill, you can use an empty module like this:
    resolve.fallback: { "zlib": false }

    Continue reading...

Compartilhe esta Página