简体   繁体   中英

Npm install doesn't work because of an error with npmcli

I got some conflicts trying to change my project into typescript, so I deleted my node modules and when I run npm install doesn't work

0 verbose cli C:\Program Files\nodejs\node.exe C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js<br>
1 info using npm@8.11.0<br>
2 info using node@v16.15.1<br>
3 timing npm:load:whichnode Completed in 0ms<br>
4 timing config:load:defaults Completed in 2ms<br>
5 timing config:load:file:C:\Program Files\nodejs\node_modules\npm\npmrc Completed in 7ms<br>
6 timing config:load:builtin Completed in 8ms<br>
7 timing config:load:cli Completed in 1ms<br>
8 timing config:load:env Completed in 0ms<br>
9 timing config:load:file:C:\Users\Altbit\Desktop\zehticket\front-zehticket\.npmrc Completed in <br>0ms
10 timing config:load:project Completed in 3ms<br>
11 timing config:load:file:C:\Users\Altbit\.npmrc Completed in 0ms<br>
12 timing config:load:user Completed in 0ms<br>
13 timing config:load:file:C:\Users\Altbit\AppData\Roaming\npm\etc\npmrc Completed in 0ms<br>
14 timing config:load:global Completed in 1ms<br>
15 timing config:load:validate Completed in 0ms<br>
16 timing config:load:credentials Completed in 1ms<br>
17 timing config:load:setEnvs Completed in 0ms<br>
18 timing config:load Completed in 17ms<br>
19 timing npm:load:configload Completed in 17ms<br>
20 timing npm:load:mkdirpcache Completed in 0ms<br>
21 timing npm:load:mkdirplogs Completed in 0ms<br>
22 verbose title npm install<br>
23 verbose argv "install"<br>
24 timing npm:load:setTitle Completed in 2ms<br>
25 timing config:load:flatten Completed in 3ms<br>
26 timing npm:load:display Completed in 4ms<br>
27 verbose logfile logs-max:10 dir:C:\Users\Altbit\AppData\Local\npm-cache\_logs<br>
28 verbose logfile C:\Users\Altbit\AppData\Local\npm-cache\_logs\2022-08-12T20_06_44_685Z-debug-<br>0.log
29 timing npm:load:logFile Completed in 11ms<br>
30 timing npm:load:timers Completed in 0ms<br>
31 timing npm:load:configScope Completed in 0ms<br>
32 timing npm:load Completed in 35ms<br>
33 timing arborist:ctor Completed in 0ms<br>
34 silly logfile start cleaning logs, removing 2 files<br>
35 silly logfile done cleaning log files<br>
36 timing idealTree:init Completed in 771ms<br>
37 timing idealTree:userRequests Completed in 1ms<br>
38 silly idealTree buildDeps<br>
39 timing idealTree:#root Completed in 0ms<br>
40 silly fetch manifest typescript@>= 2.7<br>
41 http fetch GET 200 https://registry.npmjs.org/typescript 668ms (cache hit)<br>
42 silly placeDep ROOT typescript@4.7.4 OK for: fork-ts-checker-webpack-plugin@6.5.0 want: >= 2.7<br>
43 timing idealTree:node_modules/fork-ts-checker-webpack-plugin Completed in 703ms<br>
44 silly fetch manifest react@~0.14.8 || ^15.0.0 || ^16.0.0<br>
45 http fetch GET 200 https://registry.npmjs.org/react 10ms (cache hit)<br>
46 silly fetch manifest react-dom@~0.14.8 || ^15.0.0 || ^16.0.0<br>
47 http fetch GET 200 https://registry.npmjs.org/react-dom 9ms (cache hit)<br>
48 timing idealTree Completed in 1556ms<br>
49 timing command:install Completed in 1567ms<br>
50 verbose stack Error: could not resolve<br>
50 verbose stack     at PlaceDep.failPeerConflict (C:\Program <br>Files\nodejs\node_modules\npm\node_modules\@npmcli\arborist\lib\place-dep.js:549:25)
50 verbose stack     at PlaceDep.place (C:\Program <br>Files\nodejs\node_modules\npm\node_modules\@npmcli\arborist\lib\place-dep.js:199:21)
50 verbose stack     at new PlaceDep (C:\Program <br>Files\nodejs\node_modules\npm\node_modules\@npmcli\arborist\lib\place-dep.js:73:10)
50 verbose stack     at C:\Program <br>Files\nodejs\node_modules\npm\node_modules\@npmcli\arborist\lib\arborist\build-ideal-tree.js:990:31<br>
50 verbose stack     at Array.map (<anonymous>)<br>
50 verbose stack     at Arborist.[buildDepStep] (C:\Program <br>Files\nodejs\node_modules\npm\node_modules\@npmcli\arborist\lib\arborist\build-ideal-tree.js:990:8)<br>
50 verbose stack     at async Arborist.buildIdealTree (C:\Program <br>Files\nodejs\node_modules\npm\node_modules\@npmcli\arborist\lib\arborist\build-ideal-tree.js:218:7)<br>
50 verbose stack     at async Promise.all (index 1)<br>
50 verbose stack     at async Arborist.reify (C:\Program <br>Files\nodejs\node_modules\npm\node_modules\@npmcli\arborist\lib\arborist\reify.js:153:5)
50 verbose stack     at async Install.exec (C:\Program <br>Files\nodejs\node_modules\npm\lib\commands\install.js:156:5)
51 verbose cwd C:\Users\Altbit\Desktop\zehticket\front-zehticket<br>
52 verbose Windows_NT 10.0.22000<br>
53 verbose node v16.15.1<br>
54 verbose npm  v8.11.0<br>
55 error code ERESOLVE<br>
56 error ERESOLVE could not resolve<br>
57 error<br>
58 error While resolving: [1mgoogle-maps-react[22m@[1m2.0.6[22m<br>
58 error Found: [1mreact[22m@[1m17.0.2[22m[2m[22m<br>
58 error [2mnode_modules/react[22m<br>
58 error   [1mreact[22m@"[1m^17.0.2[22m" from the root project<br>
58 error   [35mpeer[39m [1mreact[22m@"[1m>=16.x[22m" from [1m@fortawesome/react-<br>fontawesome[22m@[1m0.1.18[22m[2m[22m
58 error   [2mnode_modules/@fortawesome/react-fontawesome[22m<br>
58 error     [1m@fortawesome/react-fontawesome[22m@"[1m^0.1.18[22m" from the root project<br>
58 error   12 more (@testing-library/react, google-map-react, ...)<br>
58 error<br>
58 error Could not resolve dependency:<br>
58 error [35mpeer[39m [1mreact[22m@"[1m~0.14.8 || ^15.0.0 || ^16.0.0[22m" from [1mgoogle-<br>maps-react[22m@[1m2.0.6[22m[2m[22m
58 error [2mnode_modules/google-maps-react[22m<br>
58 error   [1mgoogle-maps-react[22m@"[1m^2.0.6[22m" from the root project<br>
58 error<br>
58 error Conflicting peer dependency: [1mreact[22m@[1m16.14.0[22m[2m[22m<br>
58 error [2mnode_modules/react[22m<br>
58 error   [35mpeer[39m [1mreact[22m@"[1m~0.14.8 || ^15.0.0 || ^16.0.0[22m" from [1mgoogle-maps-react[22m@[1m2.0.6[22m[2m[22m<br>
58 error   [2mnode_modules/google-maps-react[22m<br>
58 error     [1mgoogle-maps-react[22m@"[1m^2.0.6[22m" from the root project<br>
58 error<br>
58 error Fix the upstream dependency conflict, or retry<br>
58 error this command with --force, or --legacy-peer-deps<br>
58 error to accept an incorrect (and potentially broken) dependency resolution.<br>
58 error<br>
58 error See C:\Users\Altbit\AppData\Local\npm-cache\eresolve-report.txt for a full report.<br>
59 verbose exit 1<br>
60 timing npm Completed in 1716ms<br>
61 verbose unfinished npm timer reify 1660334804799<br>
62 verbose unfinished npm timer reify:loadTrees 1660334804807<br>
63 verbose unfinished npm timer idealTree:buildDeps 1660334805581<br>
64 verbose unfinished npm timer idealTree:node_modules/google-maps-react 1660334806287<br>
65 verbose code 1<br>
66 error A complete log of this run can be found in:<br>
66 error     C:\Users\Altbit\AppData\Local\npm-cache\_logs\2022-08-12T20_06_44_685Z-debug-0.log

I fixed the issue, this is a problem with npm version. I cant make a deep description of this error, but the solution for me was

npm install --save react-tinder-card --legacy-peer-deps

Hope help you too.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM