Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
645 views
in Technique[技术] by (71.8m points)

npm - Why am I getting an ENOENT error when running ng update?

I was having some issues running my project, so I deleted package-lock.json and node-modules, and tried running npm install.

Then I got a different error that seemed to indicate there was a Typescript/Angular mismatch. So I ran

ng update

and then got the following error:

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.

Here is my 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"
  }

Anyone have any idea why this is happening?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...