angular - 在 Ubuntu 中使用 npm install 安装 Angular 项目依赖项时遇到错误
问题描述
我安装了 Angular cli 7.3.8 版,使用 npm 链接进行了相同的链接。然后试着去做npm install
。
这会导致错误:
npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path /home/usr/mkl/node_modules/@angular-devkit/core/node_modules/fast-json-stable-stringify/package.json.2754642779
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, open '/home/usr/mkl/node_modules/@angular-devkit/core/node_modules/fast-json-stable-stringify/package.json.2754642779'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! /home/usr/.npm/_logs/2020-09-30T14_28_47_932Z-debug.log
我尝试了多种方法来解决这个问题,即node_modules
再次删除并尝试 npm install 等等,但无济于事。
npm 版本是6.14.6
角度版本是:
Angular CLI: 7.3.8
Node: 12.18.3
OS: linux x64
Angular: 8.0.3
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router
Package Version
-----------------------------------------------------------
@angular-devkit/architect 0.13.8 (cli-only)
@angular-devkit/build-angular 0.1001.3
@angular-devkit/build-optimizer 0.803.29
@angular-devkit/core 7.3.8 (cli-only)
@angular-devkit/schematics 7.3.8 (cli-only)
@angular/cli 7.3.8
@angular/http 7.2.16
@schematics/angular 7.3.8 (cli-only)
@schematics/update 0.13.8 (cli-only)
rxjs 6.6.3
typescript 3.4.5
webpack 4.39.2
解决方案
我刚刚从 to 切换npm
到yarn
并且能够安装所有依赖项而没有任何问题。
我将在此处发布此内容,以防出现更好的答案。
推荐阅读
- ios - Firebase 函数 iOS:响应不是字典
- java - 我将如何计算这个算法的大 O
- javascript - 对象方法定义的方括号语法
- azure - Azure AD B2C MFA 计费
- java - 限制 Thymeleaf + Java 中的表页数
- java - 从 SourceDataLine 创建 WAVE 文件时出现 Java UnsupportedAudioFileException
- flutter - Flutter:如何重新创建标签栏
- c++ - 如何从 C++ 中的类调用 WNDCLASSEX 上的 wndproc
- c# - 如何从函数返回对象而不输出“NameSpaxe.ObjectName”?
- java - 有没有办法让多行 JLabel 文本围绕图标流动?