无法运行NPM AUDIT FIX。

huangapple go评论164阅读模式
英文:

Cannot run NPM AUDIT FIX

问题

我们遇到了一个问题,我们重新构建了一台 Windows PC,并在克隆了我们一直在上面正常工作的项目之后,它就无法编译构建了。

这个项目是一个 Angular 7 构建项目,重建之前我们已经安装了 NVM,并在重建之前一直在使用 V14 。

package.json

  "scripts": {
    "build-prod": "node --max_old_space_size=8192 ./node_modules/@angular/cli/bin/ng build --prod",
    "build-dev": "ng serve --configuration=local --open",
    "android": "tns run android --bundle",
    "ios": "tns run ios --bundle",
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "prodbuild": "ng build --prod",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e",
    "compodoc": "npx compodoc -p src/tsconfig.app.json"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "^7.2.7",
    "@angular/cdk": "^7.3.3",
    "@angular/common": "~7.1.0",
    "@angular/compiler": "~7.1.0",
    "@angular/core": "~7.1.0",
    "@angular/flex-layout": "^7.0.0-beta.22",
    "@angular/forms": "~7.1.0",
    "@angular/material": "^7.2.0",
    "@angular/material-moment-adapter": "^7.3.3",
    "@angular/platform-browser": "~7.1.0",
    "@angular/platform-browser-dynamic": "~7.1.0",
    "@angular/platform-server": "^7.2.2",
    "@angular/pwa": "^0.11.4",
    "@angular/router": "~7.1.0",
    "@angular/service-worker": "^7.1.4",
    "@angular/youtube-player": "^8.2.3",
    "@microsoft/signalr": "^3.1.0",
    "@nativescript/schematics": "^0.4.0",
    "@ng-select/ng-select": "^2.15.2",
    "@ngx-gallery/core": "^4.0.2-beta.0",
    "@ngx-gallery/lightbox": "^4.0.2-beta.0",
    "@swimlane/ngx-charts": "^10.0.0",
    "@zxing/browser": "0.0.9",
    "@zxing/library": "^0.18.5",
    "@zxing/ngx-scanner": "^1.3.0",
    "amazing-time-picker": "^1.8.0",
    "angular-plotly.js": "^2.0.0",
    "angular-vertical-timeline": "^0.6.0",
    "angular2-signaturepad": "^2.11.0",
    "blob-polyfill": "^4.0.20190430",
    "canvas-toBlob": "^1.0.0",
    "core-js": "^2.5.4",
    "dom-to-image": "^2.6.0",
    "dom-to-image-more": "^2.8.0",
    "exif-js": "^2.3.0",
    "export-from-json": "^1.1.4",
    "file-saver": "^2.0.2",
    "guid-typescript": "^1.0.9",
    "hammerjs": "^2.0.8",
    "html2canvas": "^1.0.0-rc.1",
    "jspdf": "^1.5.3",
    "mat-select-autocomplete": "^1.3.0",
    "moment": "^2.24.0",
    "nativescript-angular": "~7.0.0",
    "nativescript-theme-core": "~1.0.4",
    "ng-circle-progress": "^1.4.0",
    "ng-pick-datetime": "^7.0.0",
    "ng-pwa-tools": "0.0.15",
    "ng2-file-upload": "^1.3.0",
    "ng2-image-compress": "^7.0.7",
    "ng2-org-chart": "^1.1.2",
    "ngx-countdown": "^3.1.0",
    "ngx-export-as": "^1.2.5",
    "ngx-gallery": "^5.9.1",
    "ngx-image-compress": "^7.2.4",
    "ngx-infinite-scroll": "^7.0.1",
    "ngx-mask": "^7.6.5",
    "ngx-moment": "^3.3.0",
    "ngx-pagination": "^3.2.1",
    "ngx-pica": "^1.1.4",
    "ngx-pipes": "^2.3.10",
    "ngx-print": "^1.2.0-beta.3",
    "ngx-timeline": "^5.0.0",
    "pdfmake": "0.1.36",
    "plotly.js": "^1.54.7",
    "pptxgenjs": "^3.2.1",
    "reflect-metadata": "~0.1.8",
    "rxjs": "^6.0.0",
    "rxjs-compat": "^6.5.3",
    "sweetalert2": "^7.33.1",
    "tns-core-modules": "~5.0.0",
    "tslib": "^1.9.0",
    "uglifyjs-webpack-plugin": "^2.1.1",
    "zone.js": "~0.8.26"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "^0.13.10",
    "@angular/cli": "^7.2.3",
    "@angular/compiler-cli": "~7.1.0",
    "@angular/language-service": "~7.1.0",
    "@kolkov/angular-editor": "^0.18.7",
    "@nativescript/schematics": "~0.4.0",
    "@types/jasmine": "~2.8.8",
    "@types/jasminewd2": "~2.0.3",
    "@types/node": "~8.9.4",
    "angular-calendar": "0.26.4",
    "classlist.js": "^1.1.20150312",
    "codelyzer": "~4.5.0",
    "date-fns": "1.30.1",
    "jasmine-core": "~2.99.1",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "~3.1.1",
    "karma-chrome-launcher": "~2.2.0",
    "karma-coverage-istanbul-reporter": "~2.

<details>
<summary>英文:</summary>

We have a problem where we&#39;ve rebuilt a Windows PC and after cloning the project that we&#39;ve been working on just fine, it will no build compile.

The project was an Angular 7 build and we have NVM installed and were using V14 just fine before the rebuild.

**package.json**

```  &quot;version&quot;: &quot;0.0.0&quot;,
  &quot;scripts&quot;: {
    &quot;build-prod&quot;: &quot;node --max_old_space_size=8192 ./node_modules/@angular/cli/bin/ng build --prod&quot;,
    &quot;build-dev&quot;: &quot;ng serve --configuration=local --open&quot;,
    &quot;android&quot;: &quot;tns run android --bundle&quot;,
    &quot;ios&quot;: &quot;tns run ios --bundle&quot;,
    &quot;ng&quot;: &quot;ng&quot;,
    &quot;start&quot;: &quot;ng serve&quot;,
    &quot;build&quot;: &quot;ng build&quot;,
    &quot;prodbuild&quot;: &quot;ng build --prod&quot;,
    &quot;test&quot;: &quot;ng test&quot;,
    &quot;lint&quot;: &quot;ng lint&quot;,
    &quot;e2e&quot;: &quot;ng e2e&quot;,
    &quot;compodoc&quot;: &quot;npx compodoc -p src/tsconfig.app.json&quot;
  },
  &quot;private&quot;: true,
  &quot;dependencies&quot;: {
    &quot;@angular/animations&quot;: &quot;^7.2.7&quot;,
    &quot;@angular/cdk&quot;: &quot;^7.3.3&quot;,
    &quot;@angular/common&quot;: &quot;~7.1.0&quot;,
    &quot;@angular/compiler&quot;: &quot;~7.1.0&quot;,
    &quot;@angular/core&quot;: &quot;~7.1.0&quot;,
    &quot;@angular/flex-layout&quot;: &quot;^7.0.0-beta.22&quot;,
    &quot;@angular/forms&quot;: &quot;~7.1.0&quot;,
    &quot;@angular/material&quot;: &quot;^7.2.0&quot;,
    &quot;@angular/material-moment-adapter&quot;: &quot;^7.3.3&quot;,
    &quot;@angular/platform-browser&quot;: &quot;~7.1.0&quot;,
    &quot;@angular/platform-browser-dynamic&quot;: &quot;~7.1.0&quot;,
    &quot;@angular/platform-server&quot;: &quot;^7.2.2&quot;,
    &quot;@angular/pwa&quot;: &quot;^0.11.4&quot;,
    &quot;@angular/router&quot;: &quot;~7.1.0&quot;,
    &quot;@angular/service-worker&quot;: &quot;^7.1.4&quot;,
    &quot;@angular/youtube-player&quot;: &quot;^8.2.3&quot;,
    &quot;@microsoft/signalr&quot;: &quot;^3.1.0&quot;,
    &quot;@nativescript/schematics&quot;: &quot;^0.4.0&quot;,
    &quot;@ng-select/ng-select&quot;: &quot;^2.15.2&quot;,
    &quot;@ngx-gallery/core&quot;: &quot;^4.0.2-beta.0&quot;,
    &quot;@ngx-gallery/lightbox&quot;: &quot;^4.0.2-beta.0&quot;,
    &quot;@swimlane/ngx-charts&quot;: &quot;^10.0.0&quot;,
    &quot;@zxing/browser&quot;: &quot;0.0.9&quot;,
    &quot;@zxing/library&quot;: &quot;^0.18.5&quot;,
    &quot;@zxing/ngx-scanner&quot;: &quot;^1.3.0&quot;,
    &quot;amazing-time-picker&quot;: &quot;^1.8.0&quot;,
    &quot;angular-plotly.js&quot;: &quot;^2.0.0&quot;,
    &quot;angular-vertical-timeline&quot;: &quot;^0.6.0&quot;,
    &quot;angular2-signaturepad&quot;: &quot;^2.11.0&quot;,
    &quot;blob-polyfill&quot;: &quot;^4.0.20190430&quot;,
    &quot;canvas-toBlob&quot;: &quot;^1.0.0&quot;,
    &quot;core-js&quot;: &quot;^2.5.4&quot;,
    &quot;dom-to-image&quot;: &quot;^2.6.0&quot;,
    &quot;dom-to-image-more&quot;: &quot;^2.8.0&quot;,
    &quot;exif-js&quot;: &quot;^2.3.0&quot;,
    &quot;export-from-json&quot;: &quot;^1.1.4&quot;,
    &quot;file-saver&quot;: &quot;^2.0.2&quot;,
    &quot;guid-typescript&quot;: &quot;^1.0.9&quot;,
    &quot;hammerjs&quot;: &quot;^2.0.8&quot;,
    &quot;html2canvas&quot;: &quot;^1.0.0-rc.1&quot;,
    &quot;jspdf&quot;: &quot;^1.5.3&quot;,
    &quot;mat-select-autocomplete&quot;: &quot;^1.3.0&quot;,
    &quot;moment&quot;: &quot;^2.24.0&quot;,
    &quot;nativescript-angular&quot;: &quot;~7.0.0&quot;,
    &quot;nativescript-theme-core&quot;: &quot;~1.0.4&quot;,
    &quot;ng-circle-progress&quot;: &quot;^1.4.0&quot;,
    &quot;ng-pick-datetime&quot;: &quot;^7.0.0&quot;,
    &quot;ng-pwa-tools&quot;: &quot;0.0.15&quot;,
    &quot;ng2-file-upload&quot;: &quot;^1.3.0&quot;,
    &quot;ng2-image-compress&quot;: &quot;^7.0.7&quot;,
    &quot;ng2-org-chart&quot;: &quot;^1.1.2&quot;,
    &quot;ngx-countdown&quot;: &quot;^3.1.0&quot;,
    &quot;ngx-export-as&quot;: &quot;^1.2.5&quot;,
    &quot;ngx-gallery&quot;: &quot;^5.9.1&quot;,
    &quot;ngx-image-compress&quot;: &quot;^7.2.4&quot;,
    &quot;ngx-infinite-scroll&quot;: &quot;^7.0.1&quot;,
    &quot;ngx-mask&quot;: &quot;^7.6.5&quot;,
    &quot;ngx-moment&quot;: &quot;^3.3.0&quot;,
    &quot;ngx-pagination&quot;: &quot;^3.2.1&quot;,
    &quot;ngx-pica&quot;: &quot;^1.1.4&quot;,
    &quot;ngx-pipes&quot;: &quot;^2.3.10&quot;,
    &quot;ngx-print&quot;: &quot;^1.2.0-beta.3&quot;,
    &quot;ngx-timeline&quot;: &quot;^5.0.0&quot;,
    &quot;pdfmake&quot;: &quot;0.1.36&quot;,
    &quot;plotly.js&quot;: &quot;^1.54.7&quot;,
    &quot;pptxgenjs&quot;: &quot;^3.2.1&quot;,
    &quot;reflect-metadata&quot;: &quot;~0.1.8&quot;,
    &quot;rxjs&quot;: &quot;^6.0.0&quot;,
    &quot;rxjs-compat&quot;: &quot;^6.5.3&quot;,
    &quot;sweetalert2&quot;: &quot;^7.33.1&quot;,
    &quot;tns-core-modules&quot;: &quot;~5.0.0&quot;,
    &quot;tslib&quot;: &quot;^1.9.0&quot;,
    &quot;uglifyjs-webpack-plugin&quot;: &quot;^2.1.1&quot;,
    &quot;zone.js&quot;: &quot;~0.8.26&quot;
  },
  &quot;devDependencies&quot;: {
    &quot;@angular-devkit/build-angular&quot;: &quot;^0.13.10&quot;,
    &quot;@angular/cli&quot;: &quot;^7.2.3&quot;,
    &quot;@angular/compiler-cli&quot;: &quot;~7.1.0&quot;,
    &quot;@angular/language-service&quot;: &quot;~7.1.0&quot;,
    &quot;@kolkov/angular-editor&quot;: &quot;^0.18.7&quot;,
    &quot;@nativescript/schematics&quot;: &quot;~0.4.0&quot;,
    &quot;@types/jasmine&quot;: &quot;~2.8.8&quot;,
    &quot;@types/jasminewd2&quot;: &quot;~2.0.3&quot;,
    &quot;@types/node&quot;: &quot;~8.9.4&quot;,
    &quot;angular-calendar&quot;: &quot;0.26.4&quot;,
    &quot;classlist.js&quot;: &quot;^1.1.20150312&quot;,
    &quot;codelyzer&quot;: &quot;~4.5.0&quot;,
    &quot;date-fns&quot;: &quot;1.30.1&quot;,
    &quot;jasmine-core&quot;: &quot;~2.99.1&quot;,
    &quot;jasmine-spec-reporter&quot;: &quot;~4.2.1&quot;,
    &quot;karma&quot;: &quot;~3.1.1&quot;,
    &quot;karma-chrome-launcher&quot;: &quot;~2.2.0&quot;,
    &quot;karma-coverage-istanbul-reporter&quot;: &quot;~2.0.1&quot;,
    &quot;karma-jasmine&quot;: &quot;~1.1.2&quot;,
    &quot;karma-jasmine-html-reporter&quot;: &quot;^0.2.2&quot;,
    &quot;nativescript-dev-webpack&quot;: &quot;^0.17.0&quot;,
    &quot;protractor&quot;: &quot;~5.4.0&quot;,
    &quot;saturn-datepicker&quot;: &quot;7.1.2&quot;,
    &quot;ts-node&quot;: &quot;~7.0.0&quot;,
    &quot;tslint&quot;: &quot;~5.11.0&quot;,
    &quot;typescript&quot;: &quot;^3.1.8&quot;,
    &quot;web-animations-js&quot;: &quot;^2.3.2&quot;
  },
  &quot;nativescript&quot;: {
    &quot;id&quot;: &quot;com.centralogic.tapinnative&quot;,
    &quot;tns-android&quot;: {
      &quot;version&quot;: &quot;5.1.0&quot;
    }
  },
  &quot;bundledDependencies&quot;: [
    &quot;date-fns&quot;,
    &quot;angular-calendar&quot;,
    &quot;saturn-datepicker&quot;
  ]
}

This creates a huge package-lock.json of over 18000 lines.

There were initial issues with gyp and node-sass that we seem to have resolved by installing Python 2.7 etc.

The errors in VS Code terminal now when trying to build:

npm ERR! Errors were found in your package-lock.json, run  npm install  to fix them.
npm ERR!     Invalid: lock file&#39;s angular-calendar@0.31.0 does not satisfy angular-calendar@0.26.4
npm ERR!     Invalid: lock file&#39;s date-fns@2.29.3 does not satisfy date-fns@1.30.1
npm ERR!     Invalid: lock file&#39;s saturn-datepicker@8.0.5 does not satisfy saturn-datepicker@7.1.2

Really baffled as this is the same package-lock.json and package.json that are in the repos and were fine before.

Any help much appreciated!

答案1

得分: 0

I'd delete the package-lock.json, then run npm install --force.

英文:

I'd delete the package-lock.json, then run npm install --force.

huangapple
  • 本文由 发表于 2023年4月6日 22:14:00
  • 转载请务必保留本文链接:https://go.coder-hub.com/75950555.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定