我在运行项目时遇到了一些问题,所以我删除了 package-lock.json
和 node-modules
,并尝试运行 npm install
。
然后我得到了一个不同的错误,似乎表明存在 Typescript/Angular 不匹配。所以我跑了
ng update
然后得到以下错误:
<块引用>npm ERR! code ENOENT
npm ERR! syscall lstat
npm ERR! path /private/var/folders/20/2x45nrc94r5f081txtrw9t640000gp/T/.ng-temp-packages-XGQVY2/lib
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, lstat '/private/var/folders/20/2x45nrc94r5f081txtrw9t640000gp/T/.ng-temp-packages-XGQVY2/lib'
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! /Users/cody/.npm/_logs/2021-01-07T07_25_19_959Z-debug.log
An unhandled exception occurred: Package install failed, see above.
See "/private/var/folders/20/2x45nrc94r5f081txtrw9t640000gp/T/ng-S420Lx/angular-errors.log" for further details.
这是我的 package.json:
"dependencies": {
"@angular-devkit/build-angular": "^0.803.21",
"@angular/animations": "^8.2.14",
"@angular/cdk": "^8.2.3",
"@angular/common": "^8.2.14",
"@angular/compiler": "^8.2.14",
"@angular/core": "^8.2.14",
"@angular/forms": "^8.2.14",
"@angular/material": "^8.2.3",
"@angular/platform-browser": "^8.2.14",
"@angular/platform-browser-dynamic": "^8.2.14",
"@angular/platform-server": "^8.2.14",
"@angular/router": "^8.2.14",
"@ngrx/effects": "^8.6.0",
"@ngrx/store": "^8.6.0",
"@ngrx/store-devtools": "^8.6.0",
"@types/cors": "^2.8.1",
"@types/express": "^4.17.6",
"body-parser": "^1.19.0",
"bootstrap": "^4.4.1",
"buttercms": "^1.2.0",
"compression": "^1.7.4",
"cookie-parser": "~1.4.4",
"core-js": "^3.6.0",
"express": "^4.17.1",
"express-jwt": "^5.1.0",
"http": "0.0.1-security",
"jsonwebtoken": "^8.5.1",
"ngrx-store-freeze": "^0.2.0",
"node-sass": "^4.14.1",
"normalize.css": "^8.0.1",
"path": "^0.12.7",
"rxjs": "^6.3.3",
"rxjs-compat": "^6.3.3",
"ts-helpers": "^1.1.2",
"ts-node": "^8.5.4",
"uuid": "^3.4.0",
"zone.js": "^0.10.2"
},
"devDependencies": {
"@angular/cli": "^8.3.21",
"@angular/compiler-cli": "^8.2.14",
"@angular/language-service": "^8.2.14",
"@types/body-parser": "^1.19.0",
"@types/compression": "^1.7.0",
"@types/jasmine": "^3.5.0",
"@types/jasminewd2": "^2.0.5",
"@types/jsonwebtoken": "^8.5.0",
"@types/node": "^13.13.12",
"@types/uuid": "^3.4.9",
"codelyzer": "^5.2.1",
"concurrently": "^5.2.0",
"copy-webpack-plugin": "^5.1.1",
"html-webpack-plugin": "^4.3.0",
"jasmine-core": "^3.2.1",
"jasmine-spec-reporter": "^4.2.1",
"karma": "^4.4.1",
"karma-chrome-launcher": "^3.1.0",
"karma-cli": "^2.0.0",
"karma-jasmine": "^2.0.1",
"karma-jasmine-html-reporter": "^1.3.1",
"nodemon": "^2.0.4",
"protractor": "^5.4.1",
"rimraf": "^3.0.0",
"rxjs-tslint": "^0.1.5",
"ts-loader": "^6.2.1",
"tslint": "^5.20.1",
"typescript": "^3.9.5",
"webdriver-manager": "12.1.7",
"webpack-cli": "^3.3.11",
"webpack-dev-middleware": "^3.7.2",
"webpack-dev-server": "^3.11.0"
}
有人知道为什么会这样吗?