【问题标题】:i am using angular 11 i want to do a project but i got errors我正在使用 angular 11 我想做一个项目,但我遇到了错误
【发布时间】:2021-05-18 12:28:41
【问题描述】:
        ng serve
An unhandled exception occurred: Cannot find module '@angular-devkit/build-angular/package.json'
See "/tmp/ng-lQbnUK/angular-errors.log" for further details.

当我创建项目时,我遇到了这些错误

installing packages (npm)...npm WARN deprecated tslint@6.1.3: TSLint has been deprecated in favor of ESLint. Please see https://github.com/palantir/tslint/issues/4534 for more information.
npm WARN deprecated chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm ERR! Unexpected end of JSON input while parsing near '...p2zraxyqI5tT/g9UTBUgK'

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/safa/.npm/_logs/2021-02-15T15_46_03_482Z-debug.log
✖ Package install failed, see above.
The Schematic workflow failed. See above.

【问题讨论】:

  • 什么项目?代码在哪里?
  • 我想打开一个新项目但我不能
  • ng 服务不起作用

标签: node.js angular npm ubuntu-20.04


【解决方案1】:

删除node modules文件夹和package-lock.json文件。

再次运行

npm install

ng serve

如果这不起作用,请升级依赖项

npm update

【讨论】:

    【解决方案2】:
    1. 删除节点模块文件夹
    2. 然后 npm i

    如果错误再次存在,那么 npm i @angular-devkit/build-angular

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-08-20
      • 2016-12-03
      • 1970-01-01
      • 2020-03-15
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多