英文:
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've rebuilt a Windows PC and after cloning the project that we'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**
``` "version": "0.0.0",
"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.0.1",
"karma-jasmine": "~1.1.2",
"karma-jasmine-html-reporter": "^0.2.2",
"nativescript-dev-webpack": "^0.17.0",
"protractor": "~5.4.0",
"saturn-datepicker": "7.1.2",
"ts-node": "~7.0.0",
"tslint": "~5.11.0",
"typescript": "^3.1.8",
"web-animations-js": "^2.3.2"
},
"nativescript": {
"id": "com.centralogic.tapinnative",
"tns-android": {
"version": "5.1.0"
}
},
"bundledDependencies": [
"date-fns",
"angular-calendar",
"saturn-datepicker"
]
}
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's angular-calendar@0.31.0 does not satisfy angular-calendar@0.26.4
npm ERR! Invalid: lock file's date-fns@2.29.3 does not satisfy date-fns@1.30.1
npm ERR! Invalid: lock file'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
.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论