无法运行NPM AUDIT FIX。

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

Cannot run NPM AUDIT FIX

问题

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

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

package.json

  1. "scripts": {
  2. "build-prod": "node --max_old_space_size=8192 ./node_modules/@angular/cli/bin/ng build --prod",
  3. "build-dev": "ng serve --configuration=local --open",
  4. "android": "tns run android --bundle",
  5. "ios": "tns run ios --bundle",
  6. "ng": "ng",
  7. "start": "ng serve",
  8. "build": "ng build",
  9. "prodbuild": "ng build --prod",
  10. "test": "ng test",
  11. "lint": "ng lint",
  12. "e2e": "ng e2e",
  13. "compodoc": "npx compodoc -p src/tsconfig.app.json"
  14. },
  15. "private": true,
  16. "dependencies": {
  17. "@angular/animations": "^7.2.7",
  18. "@angular/cdk": "^7.3.3",
  19. "@angular/common": "~7.1.0",
  20. "@angular/compiler": "~7.1.0",
  21. "@angular/core": "~7.1.0",
  22. "@angular/flex-layout": "^7.0.0-beta.22",
  23. "@angular/forms": "~7.1.0",
  24. "@angular/material": "^7.2.0",
  25. "@angular/material-moment-adapter": "^7.3.3",
  26. "@angular/platform-browser": "~7.1.0",
  27. "@angular/platform-browser-dynamic": "~7.1.0",
  28. "@angular/platform-server": "^7.2.2",
  29. "@angular/pwa": "^0.11.4",
  30. "@angular/router": "~7.1.0",
  31. "@angular/service-worker": "^7.1.4",
  32. "@angular/youtube-player": "^8.2.3",
  33. "@microsoft/signalr": "^3.1.0",
  34. "@nativescript/schematics": "^0.4.0",
  35. "@ng-select/ng-select": "^2.15.2",
  36. "@ngx-gallery/core": "^4.0.2-beta.0",
  37. "@ngx-gallery/lightbox": "^4.0.2-beta.0",
  38. "@swimlane/ngx-charts": "^10.0.0",
  39. "@zxing/browser": "0.0.9",
  40. "@zxing/library": "^0.18.5",
  41. "@zxing/ngx-scanner": "^1.3.0",
  42. "amazing-time-picker": "^1.8.0",
  43. "angular-plotly.js": "^2.0.0",
  44. "angular-vertical-timeline": "^0.6.0",
  45. "angular2-signaturepad": "^2.11.0",
  46. "blob-polyfill": "^4.0.20190430",
  47. "canvas-toBlob": "^1.0.0",
  48. "core-js": "^2.5.4",
  49. "dom-to-image": "^2.6.0",
  50. "dom-to-image-more": "^2.8.0",
  51. "exif-js": "^2.3.0",
  52. "export-from-json": "^1.1.4",
  53. "file-saver": "^2.0.2",
  54. "guid-typescript": "^1.0.9",
  55. "hammerjs": "^2.0.8",
  56. "html2canvas": "^1.0.0-rc.1",
  57. "jspdf": "^1.5.3",
  58. "mat-select-autocomplete": "^1.3.0",
  59. "moment": "^2.24.0",
  60. "nativescript-angular": "~7.0.0",
  61. "nativescript-theme-core": "~1.0.4",
  62. "ng-circle-progress": "^1.4.0",
  63. "ng-pick-datetime": "^7.0.0",
  64. "ng-pwa-tools": "0.0.15",
  65. "ng2-file-upload": "^1.3.0",
  66. "ng2-image-compress": "^7.0.7",
  67. "ng2-org-chart": "^1.1.2",
  68. "ngx-countdown": "^3.1.0",
  69. "ngx-export-as": "^1.2.5",
  70. "ngx-gallery": "^5.9.1",
  71. "ngx-image-compress": "^7.2.4",
  72. "ngx-infinite-scroll": "^7.0.1",
  73. "ngx-mask": "^7.6.5",
  74. "ngx-moment": "^3.3.0",
  75. "ngx-pagination": "^3.2.1",
  76. "ngx-pica": "^1.1.4",
  77. "ngx-pipes": "^2.3.10",
  78. "ngx-print": "^1.2.0-beta.3",
  79. "ngx-timeline": "^5.0.0",
  80. "pdfmake": "0.1.36",
  81. "plotly.js": "^1.54.7",
  82. "pptxgenjs": "^3.2.1",
  83. "reflect-metadata": "~0.1.8",
  84. "rxjs": "^6.0.0",
  85. "rxjs-compat": "^6.5.3",
  86. "sweetalert2": "^7.33.1",
  87. "tns-core-modules": "~5.0.0",
  88. "tslib": "^1.9.0",
  89. "uglifyjs-webpack-plugin": "^2.1.1",
  90. "zone.js": "~0.8.26"
  91. },
  92. "devDependencies": {
  93. "@angular-devkit/build-angular": "^0.13.10",
  94. "@angular/cli": "^7.2.3",
  95. "@angular/compiler-cli": "~7.1.0",
  96. "@angular/language-service": "~7.1.0",
  97. "@kolkov/angular-editor": "^0.18.7",
  98. "@nativescript/schematics": "~0.4.0",
  99. "@types/jasmine": "~2.8.8",
  100. "@types/jasminewd2": "~2.0.3",
  101. "@types/node": "~8.9.4",
  102. "angular-calendar": "0.26.4",
  103. "classlist.js": "^1.1.20150312",
  104. "codelyzer": "~4.5.0",
  105. "date-fns": "1.30.1",
  106. "jasmine-core": "~2.99.1",
  107. "jasmine-spec-reporter": "~4.2.1",
  108. "karma": "~3.1.1",
  109. "karma-chrome-launcher": "~2.2.0",
  110. "karma-coverage-istanbul-reporter": "~2.
  111. <details>
  112. <summary>英文:</summary>
  113. 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.
  114. The project was an Angular 7 build and we have NVM installed and were using V14 just fine before the rebuild.
  115. **package.json**
  116. ``` &quot;version&quot;: &quot;0.0.0&quot;,
  117. &quot;scripts&quot;: {
  118. &quot;build-prod&quot;: &quot;node --max_old_space_size=8192 ./node_modules/@angular/cli/bin/ng build --prod&quot;,
  119. &quot;build-dev&quot;: &quot;ng serve --configuration=local --open&quot;,
  120. &quot;android&quot;: &quot;tns run android --bundle&quot;,
  121. &quot;ios&quot;: &quot;tns run ios --bundle&quot;,
  122. &quot;ng&quot;: &quot;ng&quot;,
  123. &quot;start&quot;: &quot;ng serve&quot;,
  124. &quot;build&quot;: &quot;ng build&quot;,
  125. &quot;prodbuild&quot;: &quot;ng build --prod&quot;,
  126. &quot;test&quot;: &quot;ng test&quot;,
  127. &quot;lint&quot;: &quot;ng lint&quot;,
  128. &quot;e2e&quot;: &quot;ng e2e&quot;,
  129. &quot;compodoc&quot;: &quot;npx compodoc -p src/tsconfig.app.json&quot;
  130. },
  131. &quot;private&quot;: true,
  132. &quot;dependencies&quot;: {
  133. &quot;@angular/animations&quot;: &quot;^7.2.7&quot;,
  134. &quot;@angular/cdk&quot;: &quot;^7.3.3&quot;,
  135. &quot;@angular/common&quot;: &quot;~7.1.0&quot;,
  136. &quot;@angular/compiler&quot;: &quot;~7.1.0&quot;,
  137. &quot;@angular/core&quot;: &quot;~7.1.0&quot;,
  138. &quot;@angular/flex-layout&quot;: &quot;^7.0.0-beta.22&quot;,
  139. &quot;@angular/forms&quot;: &quot;~7.1.0&quot;,
  140. &quot;@angular/material&quot;: &quot;^7.2.0&quot;,
  141. &quot;@angular/material-moment-adapter&quot;: &quot;^7.3.3&quot;,
  142. &quot;@angular/platform-browser&quot;: &quot;~7.1.0&quot;,
  143. &quot;@angular/platform-browser-dynamic&quot;: &quot;~7.1.0&quot;,
  144. &quot;@angular/platform-server&quot;: &quot;^7.2.2&quot;,
  145. &quot;@angular/pwa&quot;: &quot;^0.11.4&quot;,
  146. &quot;@angular/router&quot;: &quot;~7.1.0&quot;,
  147. &quot;@angular/service-worker&quot;: &quot;^7.1.4&quot;,
  148. &quot;@angular/youtube-player&quot;: &quot;^8.2.3&quot;,
  149. &quot;@microsoft/signalr&quot;: &quot;^3.1.0&quot;,
  150. &quot;@nativescript/schematics&quot;: &quot;^0.4.0&quot;,
  151. &quot;@ng-select/ng-select&quot;: &quot;^2.15.2&quot;,
  152. &quot;@ngx-gallery/core&quot;: &quot;^4.0.2-beta.0&quot;,
  153. &quot;@ngx-gallery/lightbox&quot;: &quot;^4.0.2-beta.0&quot;,
  154. &quot;@swimlane/ngx-charts&quot;: &quot;^10.0.0&quot;,
  155. &quot;@zxing/browser&quot;: &quot;0.0.9&quot;,
  156. &quot;@zxing/library&quot;: &quot;^0.18.5&quot;,
  157. &quot;@zxing/ngx-scanner&quot;: &quot;^1.3.0&quot;,
  158. &quot;amazing-time-picker&quot;: &quot;^1.8.0&quot;,
  159. &quot;angular-plotly.js&quot;: &quot;^2.0.0&quot;,
  160. &quot;angular-vertical-timeline&quot;: &quot;^0.6.0&quot;,
  161. &quot;angular2-signaturepad&quot;: &quot;^2.11.0&quot;,
  162. &quot;blob-polyfill&quot;: &quot;^4.0.20190430&quot;,
  163. &quot;canvas-toBlob&quot;: &quot;^1.0.0&quot;,
  164. &quot;core-js&quot;: &quot;^2.5.4&quot;,
  165. &quot;dom-to-image&quot;: &quot;^2.6.0&quot;,
  166. &quot;dom-to-image-more&quot;: &quot;^2.8.0&quot;,
  167. &quot;exif-js&quot;: &quot;^2.3.0&quot;,
  168. &quot;export-from-json&quot;: &quot;^1.1.4&quot;,
  169. &quot;file-saver&quot;: &quot;^2.0.2&quot;,
  170. &quot;guid-typescript&quot;: &quot;^1.0.9&quot;,
  171. &quot;hammerjs&quot;: &quot;^2.0.8&quot;,
  172. &quot;html2canvas&quot;: &quot;^1.0.0-rc.1&quot;,
  173. &quot;jspdf&quot;: &quot;^1.5.3&quot;,
  174. &quot;mat-select-autocomplete&quot;: &quot;^1.3.0&quot;,
  175. &quot;moment&quot;: &quot;^2.24.0&quot;,
  176. &quot;nativescript-angular&quot;: &quot;~7.0.0&quot;,
  177. &quot;nativescript-theme-core&quot;: &quot;~1.0.4&quot;,
  178. &quot;ng-circle-progress&quot;: &quot;^1.4.0&quot;,
  179. &quot;ng-pick-datetime&quot;: &quot;^7.0.0&quot;,
  180. &quot;ng-pwa-tools&quot;: &quot;0.0.15&quot;,
  181. &quot;ng2-file-upload&quot;: &quot;^1.3.0&quot;,
  182. &quot;ng2-image-compress&quot;: &quot;^7.0.7&quot;,
  183. &quot;ng2-org-chart&quot;: &quot;^1.1.2&quot;,
  184. &quot;ngx-countdown&quot;: &quot;^3.1.0&quot;,
  185. &quot;ngx-export-as&quot;: &quot;^1.2.5&quot;,
  186. &quot;ngx-gallery&quot;: &quot;^5.9.1&quot;,
  187. &quot;ngx-image-compress&quot;: &quot;^7.2.4&quot;,
  188. &quot;ngx-infinite-scroll&quot;: &quot;^7.0.1&quot;,
  189. &quot;ngx-mask&quot;: &quot;^7.6.5&quot;,
  190. &quot;ngx-moment&quot;: &quot;^3.3.0&quot;,
  191. &quot;ngx-pagination&quot;: &quot;^3.2.1&quot;,
  192. &quot;ngx-pica&quot;: &quot;^1.1.4&quot;,
  193. &quot;ngx-pipes&quot;: &quot;^2.3.10&quot;,
  194. &quot;ngx-print&quot;: &quot;^1.2.0-beta.3&quot;,
  195. &quot;ngx-timeline&quot;: &quot;^5.0.0&quot;,
  196. &quot;pdfmake&quot;: &quot;0.1.36&quot;,
  197. &quot;plotly.js&quot;: &quot;^1.54.7&quot;,
  198. &quot;pptxgenjs&quot;: &quot;^3.2.1&quot;,
  199. &quot;reflect-metadata&quot;: &quot;~0.1.8&quot;,
  200. &quot;rxjs&quot;: &quot;^6.0.0&quot;,
  201. &quot;rxjs-compat&quot;: &quot;^6.5.3&quot;,
  202. &quot;sweetalert2&quot;: &quot;^7.33.1&quot;,
  203. &quot;tns-core-modules&quot;: &quot;~5.0.0&quot;,
  204. &quot;tslib&quot;: &quot;^1.9.0&quot;,
  205. &quot;uglifyjs-webpack-plugin&quot;: &quot;^2.1.1&quot;,
  206. &quot;zone.js&quot;: &quot;~0.8.26&quot;
  207. },
  208. &quot;devDependencies&quot;: {
  209. &quot;@angular-devkit/build-angular&quot;: &quot;^0.13.10&quot;,
  210. &quot;@angular/cli&quot;: &quot;^7.2.3&quot;,
  211. &quot;@angular/compiler-cli&quot;: &quot;~7.1.0&quot;,
  212. &quot;@angular/language-service&quot;: &quot;~7.1.0&quot;,
  213. &quot;@kolkov/angular-editor&quot;: &quot;^0.18.7&quot;,
  214. &quot;@nativescript/schematics&quot;: &quot;~0.4.0&quot;,
  215. &quot;@types/jasmine&quot;: &quot;~2.8.8&quot;,
  216. &quot;@types/jasminewd2&quot;: &quot;~2.0.3&quot;,
  217. &quot;@types/node&quot;: &quot;~8.9.4&quot;,
  218. &quot;angular-calendar&quot;: &quot;0.26.4&quot;,
  219. &quot;classlist.js&quot;: &quot;^1.1.20150312&quot;,
  220. &quot;codelyzer&quot;: &quot;~4.5.0&quot;,
  221. &quot;date-fns&quot;: &quot;1.30.1&quot;,
  222. &quot;jasmine-core&quot;: &quot;~2.99.1&quot;,
  223. &quot;jasmine-spec-reporter&quot;: &quot;~4.2.1&quot;,
  224. &quot;karma&quot;: &quot;~3.1.1&quot;,
  225. &quot;karma-chrome-launcher&quot;: &quot;~2.2.0&quot;,
  226. &quot;karma-coverage-istanbul-reporter&quot;: &quot;~2.0.1&quot;,
  227. &quot;karma-jasmine&quot;: &quot;~1.1.2&quot;,
  228. &quot;karma-jasmine-html-reporter&quot;: &quot;^0.2.2&quot;,
  229. &quot;nativescript-dev-webpack&quot;: &quot;^0.17.0&quot;,
  230. &quot;protractor&quot;: &quot;~5.4.0&quot;,
  231. &quot;saturn-datepicker&quot;: &quot;7.1.2&quot;,
  232. &quot;ts-node&quot;: &quot;~7.0.0&quot;,
  233. &quot;tslint&quot;: &quot;~5.11.0&quot;,
  234. &quot;typescript&quot;: &quot;^3.1.8&quot;,
  235. &quot;web-animations-js&quot;: &quot;^2.3.2&quot;
  236. },
  237. &quot;nativescript&quot;: {
  238. &quot;id&quot;: &quot;com.centralogic.tapinnative&quot;,
  239. &quot;tns-android&quot;: {
  240. &quot;version&quot;: &quot;5.1.0&quot;
  241. }
  242. },
  243. &quot;bundledDependencies&quot;: [
  244. &quot;date-fns&quot;,
  245. &quot;angular-calendar&quot;,
  246. &quot;saturn-datepicker&quot;
  247. ]
  248. }

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:

  1. npm ERR! Errors were found in your package-lock.json, run npm install to fix them.
  2. npm ERR! Invalid: lock file&#39;s angular-calendar@0.31.0 does not satisfy angular-calendar@0.26.4
  3. npm ERR! Invalid: lock file&#39;s date-fns@2.29.3 does not satisfy date-fns@1.30.1
  4. 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:

确定