我目前正在使用一个项目。它工作正常,但问题是当我将项目文件(除了node_modules
)删除到另一个文件夹或GitHub时,通过npm重新安装包不成功。它总是挂在extract:rxjs: sill extract big.js@3.1.3
我试了npm cache verify
没有运气。packages.json
{
"name": "esas",
"version": "0.0.0",
"license": "MIT",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"@angular/animations": "^4.2.4",
"@angular/cdk": "^2.0.0-beta.10",
"@angular/common": "^4.2.4",
"@angular/compiler": "^4.2.4",
"@angular/core": "^4.2.4",
"@angular/forms": "^4.2.4",
"@angular/http": "^4.2.4",
"@angular/material": "^2.0.0-beta.10",
"@angular/platform-browser": "^4.2.4",
"@angular/platform-browser-dynamic": "^4.2.4",
"@angular/router": "^4.2.4",
"@ng-bootstrap/ng-bootstrap": "^1.0.0-beta.3",
"angular2-loaders-css": "^1.0.9",
"angular2-perfect-scrollbar": "^2.0.6",
"bootstrap": "^4.0.0-beta",
"core-js": "^2.4.1",
"material-design-icons": "^3.0.1",
"node-sass": "^4.5.3",
"rxjs": "^5.4.2",
"zone.js": "^0.8.14"
},
"devDependencies": {
"@angular/cli": "1.3.2",
"@angular/compiler-cli": "^4.2.4",
"@angular/language-service": "^4.2.4",
"@types/jasmine": "~2.5.53",
"@types/jasminewd2": "~2.0.2",
"@types/node": "~6.0.60",
"codelyzer": "~3.1.1",
"jasmine-core": "~2.6.2",
"jasmine-spec-reporter": "~4.1.0",
"karma": "~1.7.0",
"karma-chrome-launcher": "~2.1.1",
"karma-cli": "~1.0.1",
"karma-coverage-istanbul-reporter": "^1.2.1",
"karma-jasmine": "~1.1.0",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "~5.1.2",
"ts-node": "~3.2.0",
"tslint": "~5.3.2",
"typescript": "~2.3.3"
}
}
我正在使用:
- Windows 10系统
- 节点版本:8.50
有什么想法是错的吗?亲切问候
4条答案
按热度按时间zwghvu4y1#
解决问题的方式
1.删除
package-lock.json
1.删除
node_modules
文件夹1.再次运行
npm install
。(花了30分钟完成,但最终完成了)ymdaylpp2#
我认为安德烈的回答是正确的。没有抛出错误,它似乎只是挂起,但在搜索修复程序时,软件包最终下载并完成安装过程。大概需要7-8分钟。也许是特定于rxjs包的?但我不建议删除
package-lock.json
文件作为修复。如果/node_modules
文件夹已经存在,您可以尝试删除它。q9yhzks03#
有一次,一个包裹似乎卡住了。我只需要等待15分钟,它就完成了。
xfb7svmp4#
所以对我来说,这看起来是一个全局Angular缓存变得混乱的问题。我从一个我们正在升级到Angular 15的分支(Material更改使我们很难迁移)切换到Angular 14分支,以修复我们客户端的错误,每当我切换时,我注意到安装Angular Material和RxJS将冻结安装,然后最终打破我运行命令的窗口。我通常需要执行以下步骤来修复它:
1.拆下 Package 锁。json
1.删除node_modules文件夹
1.取下。angular/cache文件夹(如果找到)
1.运行npm install
如果这不起作用,那么我尝试重新启动计算机。通常这是可行的,但随后会导致这两个软件包每个需要3-5分钟才能安装。如果这不起作用,那么我必须清除全局Angular 缓存(我不建议这样做),但之后它通常会像正常一样运行安装。