找回密码
 注册
查看: 173|回复: 1

将npm和cnpm组件升级到最新版本

[复制链接]

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
发表于 2025-7-29 10:22:27 | 显示全部楼层 |阅读模式
将npm和cnpm组件升级到最新版本* m: M/ s; [1 l4 ?7 T
PS C:\Users\admin\projects> npm i cnpm@latest8 Y0 `) J: c$ k1 T
. B% S& _/ Z/ r4 A
added 1 package in 1m
) S2 ]6 y& x" d* {9 I/ U" ^7 u/ Y% c8 c" C1 ]
55 packages are looking for funding: u( Q3 b$ g& w. R; R% ^
  run `npm fund` for details6 A) H& o/ g1 P  f8 x  d2 k6 e
' {6 Q- B7 q% \& T" s) o# H
PS C:\Users\admin\projects> cnpm i -g npm@latest
  W5 b0 Y: _1 L( g- _; t! W. p3 BDownloading npm to C:\Users\admin\AppData\Roaming\npm\node_modules\npm_tmp
3 g# I! s) W- x0 G$ o7 ^- PCopying C:\Users\admin\AppData\Roaming\npm\node_modules\npm_tmp\.store\npm@11.5.1\node_modules\npm to C:\Users\admin\AppData\Roaming\npm\node_modules\npm
& v5 F, C/ d0 \Installing npm's dependencies to C:\Users\admin\AppData\Roaming\npm\node_modules\npm/node_modules
7 k) ?' f0 d1 W2 C5 t+ q[1/66] Package @isaacs/string-locale-compare@^1.1.0 is skipped because it already exists at: C:\Users\admin\AppData\Roaming\npm\node_modules\npm\node_modules\@isaacs\string-locale-compare! H2 R- H+ _/ c8 J' f% T
[2/66] Package @npmcli/arborist@^9.1.3 is skipped because it already exists at: C:\Users\admin\AppData\Roaming\npm\node_modules\npm\node_modules\@npmcli\arborist* w8 _. I; R& i. J$ m, L( @5 s
[3/66] Package @npmcli/config@^10.3.1 is skipped because it already exists at: C:\Users\admin\AppData\Roaming\npm\node_modules\npm\node_modules\@npmcli\config2 `- N9 Y3 s2 M1 t7 c2 r
[4/66] Package @npmcli/fs@^4.0.0 is skipped because it already exists at: C:\Users\admin\AppData\Roaming\npm\node_modules\npm\node_modules\@npmcli\fs
) Y0 j% R4 _% }9 q: D; o[5/66] Package @npmcli/map-workspaces@^4.0.2 is skipped because it already exists at: C:\Users\admin\AppData\Roaming\npm\node_modules\npm\node_modules\@npmcli\map-workspaces ! D& B1 V# m& D  H
[6/66] Package @npmcli/package-json@^6.2.0 is skipped because it already exists at: C:\Users\admin\AppData\Roaming\npm\node_modules\npm\node_modules\@npmcli\package-json     
  r7 L. ^* c$ w$ r$ U[7/66] Package @npmcli/promise-spawn@^8.0.2 is skipped because it already exists at: C:\Users\admin\AppData\Roaming\npm\node_modules\npm\node_modules\@npmcli\promise-spawn   % _4 w. N! Z7 r# \) f1 i
[8/66] Package @npmcli/run-script@^9.1.0 is skipped because it already exists at: C:\Users\admin\AppData\Roaming\npm\node_modules\npm\node_modules\@npmcli\run-script
. L* V8 x' u. q2 i' G$ a$ T[9/66] Package @npmcli/redact@^3.2.2 is skipped because it already exists at: C:\Users\admin\AppData\Roaming\npm\node_modules\npm\node_modules\@npmcli\redact
' ]* f# x9 S8 ]5 d! |( _7 o, z[10/66] Package @sigstore/tuf@^3.1.1 is skipped because it already exists at: C:\Users\admin\AppData\Roaming\npm\node_modules\npm\node_modules\@sigstore\tuf+ e" G; ^$ G! v+ I# H2 T
[11/66] Package abbrev@^3.0.1 is skipped because it already exists at: C:\Users\admin\AppData\Roaming\npm\node_modules\npm\node_modules\abbrev  W" ?  f. F; M1 l8 c1 p9 ]0 q
[12/66] Package archy@~1.0.0 is skipped because it already exists at: C:\Users\admin\AppData\Roaming\npm\node_modules\npm\node_modules\archy$ z2 e7 @- W& L* @' w
[13/66] Package cacache@^19.0.1 is skipped because it already exists at: C:\Users\admin\AppData\Roaming\npm\node_modules\npm\node_modules\cacache
8 j% ~& W+ t  K0 C7 _: N" j[14/66] Package chalk@^5.4.1 is skipped because it already exists at: C:\Users\admin\AppData\Roaming\npm\node_modules\npm\node_modules\chalk' B4 b0 q. e, K" f" `
[15/66] Package ci-info@^4.3.0 is skipped because it already exists at: C:\Users\admin\AppData\Roaming\npm\node_modules\npm\node_modules\ci-info
. y4 T6 o; y" o# E  G# U- W1 ~[16/66] Package cli-columns@^4.0.0 is skipped because it already exists at: C:\Users\admin\AppData\Roaming\npm\node_modules\npm\node_modules\cli-columns
  W; t& @) S3 k* m3 ~, v, t[17/66] Package fs-minipass@^3.0.3 is skipped because it already exists at: C:\Users\admin\AppData\Roaming\npm\node_modules\npm\node_modules\fs-minipass
( w4 o7 T) c  p, L4 v[18/66] Package fastest-levenshtein@^1.0.16 is skipped because it already exists at: C:\Users\admin\AppData\Roaming\npm\node_modules\npm\node_modules\fastest-levenshtein     . c" A! F0 U& k" F
[19/66] Package glob@^10.4.5 is skipped because it already exists at: C:\Users\admin\AppData\Roaming\npm\node_modules\npm\node_modules\glob* C) y* t9 y) I3 ?" _
[20/66] Package graceful-fs@^4.2.11 is skipped because it already exists at: C:\Users\admin\AppData\Roaming\npm\node_modules\npm\node_modules\graceful-fs1 a) a4 b, Y  s, l& m% ?( m4 X3 n
[21/66] Package hosted-git-info@^8.1.0 is skipped because it already exists at: C:\Users\admin\AppData\Roaming\npm\node_modules\npm\node_modules\hosted-git-info' J; X7 O- o/ t) a( N
[22/66] Package init-package-json@^8.2.1 is skipped because it already exists at: C:\Users\admin\AppData\Roaming\npm\node_modules\npm\node_modules\init-package-json
2 M" Y! \) |4 W[23/66] Package ini@^5.0.0 is skipped because it already exists at: C:\Users\admin\AppData\Roaming\npm\node_modules\npm\node_modules\ini/ K9 R$ x$ g4 B+ S! s5 L
[24/66] Package is-cidr@^5.1.1 is skipped because it already exists at: C:\Users\admin\AppData\Roaming\npm\node_modules\npm\node_modules\is-cidr
! {6 z6 o9 C; y) I5 z[25/66] Package json-parse-even-better-errors@^4.0.0 is skipped because it already exists at: C:\Users\admin\AppData\Roaming\npm\node_modules\npm\node_modules\json-parse-even-better-errors: V! n/ j5 X+ h9 Q0 e" }
[26/66] Package libnpmaccess@^10.0.1 is skipped because it already exists at: C:\Users\admin\AppData\Roaming\npm\node_modules\npm\node_modules\libnpmaccess, Q" s5 ^$ k. q$ Z4 n6 y
[27/66] Package libnpmdiff@^8.0.6 is skipped because it already exists at: C:\Users\admin\AppData\Roaming\npm\node_modules\npm\node_modules\libnpmdiff+ N* T- A4 ?5 C9 N  f* W
[28/66] Package libnpmexec@^10.1.5 is skipped because it already exists at: C:\Users\admin\AppData\Roaming\npm\node_modules\npm\node_modules\libnpmexec
1 Z0 x9 q" |) g' w! [8 @[29/66] Package libnpmfund@^7.0.6 is skipped because it already exists at: C:\Users\admin\AppData\Roaming\npm\node_modules\npm\node_modules\libnpmfund' j% J7 J+ j  a0 |1 E! X6 v
[30/66] Package libnpmorg@^8.0.0 is skipped because it already exists at: C:\Users\admin\AppData\Roaming\npm\node_modules\npm\node_modules\libnpmorg
7 Z% n2 f2 J& @3 u0 I7 ][31/66] Package libnpmpack@^9.0.6 is skipped because it already exists at: C:\Users\admin\AppData\Roaming\npm\node_modules\npm\node_modules\libnpmpack  p$ m! L- z: `( w. e, _% U# x' a
[32/66] Package libnpmpublish@^11.1.0 is skipped because it already exists at: C:\Users\admin\AppData\Roaming\npm\node_modules\npm\node_modules\libnpmpublish- H+ w+ n/ K/ n' q/ n5 L5 L! E
[33/66] Package libnpmsearch@^9.0.0 is skipped because it already exists at: C:\Users\admin\AppData\Roaming\npm\node_modules\npm\node_modules\libnpmsearch
& p7 j0 z2 x3 z# W1 f& s1 C: I[34/66] Package libnpmteam@^8.0.1 is skipped because it already exists at: C:\Users\admin\AppData\Roaming\npm\node_modules\npm\node_modules\libnpmteam( `( S& \" o9 O. y2 r
[35/66] Package libnpmversion@^8.0.1 is skipped because it already exists at: C:\Users\admin\AppData\Roaming\npm\node_modules\npm\node_modules\libnpmversion4 t, t9 u% m. ~, B+ J
[36/66] Package make-fetch-happen@^14.0.3 is skipped because it already exists at: C:\Users\admin\AppData\Roaming\npm\node_modules\npm\node_modules\make-fetch-happen
1 N4 V* }7 ?% y6 U9 ~) n1 N5 }  A  H) G[37/66] Package minimatch@^9.0.5 is skipped because it already exists at: C:\Users\admin\AppData\Roaming\npm\node_modules\npm\node_modules\minimatch. |4 q" O! o3 y: d( w% I7 G# W% j" M
[38/66] Package minipass@^7.1.1 is skipped because it already exists at: C:\Users\admin\AppData\Roaming\npm\node_modules\npm\node_modules\minipass' a4 K, d( a1 M. t# f
[39/66] Package minipass-pipeline@^1.2.4 is skipped because it already exists at: C:\Users\admin\AppData\Roaming\npm\node_modules\npm\node_modules\minipass-pipeline1 _" B1 Z/ e4 M, K* f' e* B+ H
[40/66] Package ms@^2.1.2 is skipped because it already exists at: C:\Users\admin\AppData\Roaming\npm\node_modules\npm\node_modules\ms
: }2 i5 J% I+ F; \: ][41/66] Package node-gyp@^11.2.0 is skipped because it already exists at: C:\Users\admin\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp* O' J  o1 f( q
[42/66] Package nopt@^8.1.0 is skipped because it already exists at: C:\Users\admin\AppData\Roaming\npm\node_modules\npm\node_modules\nopt! I& S! z+ K1 q4 r
[43/66] Package normalize-package-data@^7.0.1 is skipped because it already exists at: C:\Users\admin\AppData\Roaming\npm\node_modules\npm\node_modules\normalize-package-data[44/66] Package npm-audit-report@^6.0.0 is skipped because it already exists at: C:\Users\admin\AppData\Roaming\npm\node_modules\npm\node_modules\npm-audit-report
' B& P( t5 o$ w) M% P* W  i1 k[45/66] Package npm-install-checks@^7.1.1 is skipped because it already exists at: C:\Users\admin\AppData\Roaming\npm\node_modules\npm\node_modules\npm-install-checks
: L6 E3 h7 Z7 G[46/66] Package npm-package-arg@^12.0.2 is skipped because it already exists at: C:\Users\admin\AppData\Roaming\npm\node_modules\npm\node_modules\npm-package-arg4 r" t) p$ Q* E3 [1 s2 u: Y
[47/66] Package npm-pick-manifest@^10.0.0 is skipped because it already exists at: C:\Users\admin\AppData\Roaming\npm\node_modules\npm\node_modules\npm-pick-manifest9 H) ], O7 e- P' n+ o) j& o" }: O
[48/66] Package npm-profile@^11.0.1 is skipped because it already exists at: C:\Users\admin\AppData\Roaming\npm\node_modules\npm\node_modules\npm-profile
. P) u3 X+ a8 e' b[49/66] Package npm-registry-fetch@^18.0.2 is skipped because it already exists at: C:\Users\admin\AppData\Roaming\npm\node_modules\npm\node_modules\npm-registry-fetch       ; y0 `# n  l4 D* I- c8 T
[50/66] Package npm-user-validate@^3.0.0 is skipped because it already exists at: C:\Users\admin\AppData\Roaming\npm\node_modules\npm\node_modules\npm-user-validate, V1 e1 s' r9 c8 |# L1 T+ w
[51/66] Package p-map@^7.0.3 is skipped because it already exists at: C:\Users\admin\AppData\Roaming\npm\node_modules\npm\node_modules\p-map
& P' T; k9 W* k+ r% o* r[52/66] Package pacote@^21.0.0 is skipped because it already exists at: C:\Users\admin\AppData\Roaming\npm\node_modules\npm\node_modules\pacote
. L/ X) r/ ^8 Y. l* m7 h# I[53/66] Package parse-conflict-json@^4.0.0 is skipped because it already exists at: C:\Users\admin\AppData\Roaming\npm\node_modules\npm\node_modules\parse-conflict-json      - y* S+ A$ [# o$ w- O4 I6 h: i: i
[54/66] Package proc-log@^5.0.0 is skipped because it already exists at: C:\Users\admin\AppData\Roaming\npm\node_modules\npm\node_modules\proc-log9 r4 B4 d6 `  O; H
[55/66] Package qrcode-terminal@^0.12.0 is skipped because it already exists at: C:\Users\admin\AppData\Roaming\npm\node_modules\npm\node_modules\qrcode-terminal
- ]: y% R$ O- f  @& `/ F! B[56/66] Package read@^4.1.0 is skipped because it already exists at: C:\Users\admin\AppData\Roaming\npm\node_modules\npm\node_modules\read
+ f8 Q$ M- {6 F, a0 e[57/66] Package semver@^7.7.2 is skipped because it already exists at: C:\Users\admin\AppData\Roaming\npm\node_modules\npm\node_modules\semver
+ V7 k+ b$ g# |" {; W2 E( d5 {[58/66] Package spdx-expression-parse@^4.0.0 is skipped because it already exists at: C:\Users\admin\AppData\Roaming\npm\node_modules\npm\node_modules\spdx-expression-parse  
, I' ~% c6 L3 K* h: x) G; X[59/66] Package ssri@^12.0.0 is skipped because it already exists at: C:\Users\admin\AppData\Roaming\npm\node_modules\npm\node_modules\ssri
$ A) i9 F, H/ [7 L* j& L[61/66] Package tar@^6.2.1 is skipped because it already exists at: C:\Users\admin\AppData\Roaming\npm\node_modules\npm\node_modules\tar
" |( c# |7 R+ ^7 b[63/66] Package tiny-relative-date@^1.3.0 is skipped because it already exists at: C:\Users\admin\AppData\Roaming\npm\node_modules\npm\node_modules\tiny-relative-date        
. b* c1 \/ H/ }% {+ f[64/66] Package treeverse@^3.0.0 is skipped because it already exists at: C:\Users\admin\AppData\Roaming\npm\node_modules\npm\node_modules\treeverse4 {0 G% p; {7 o; r- Z
[65/66] Package validate-npm-package-name@^6.0.2 is skipped because it already exists at: C:\Users\admin\AppData\Roaming\npm\node_modules\npm\node_modules\validate-npm-package-name) J3 t8 o' f( f4 j
[66/66] Package which@^5.0.0 is skipped because it already exists at: C:\Users\admin\AppData\Roaming\npm\node_modules\npm\node_modules\which! F0 \* X3 m9 l
[npm@11.5.1] link C:\Users\admin\AppData\Roaming\npm\npm@ -> C:\Users\admin\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js6 C! q* \; G7 {  A
[npm@11.5.1] link C:\Users\admin\AppData\Roaming\npm\npx@ -> C:\Users\admin\AppData\Roaming\npm\node_modules\npm\bin\npx-cli.js
% i7 M- I( Y9 x$ F& z1 f! D9 u2 ]5 w$ i
PS C:\Users\admin\projects> npm -v
5 M  a! P4 t/ ?) ?; P9 `11.5.1- j. d- m+ H* W, I
PS C:\Users\admin\projects> npm i cnpm@latest
5 C( U( h- e- q6 L
: k( Q- w, ]2 B) r. K/ tadded 1 package in 1m' k& H8 K$ H$ J# C, l5 Y7 h/ U

# S; l+ @: ?0 j; K9 O4 h55 packages are looking for funding; B. n$ Q" U! X, G
  run `npm fund` for details7 g" Q# W7 r- U3 s2 q& H
PS C:\Users\admin\projects> cnpm -v
+ H" R7 E- {  |+ e4 c2 ^/ ?- Ecnpm@9.4.0 (C:\Users\admin\AppData\Roaming\npm\node_modules\cnpm\lib\parse_argv.js)
' \( }; l5 l2 O3 V& vnpm@9.9.2 (C:\Users\admin\AppData\Roaming\npm\node_modules\cnpm\node_modules\npm\index.js)" o5 o; d# B1 l" r3 s- Z5 v' B
node@24.4.1 (C:\Program Files\nodejs\node.exe)# ^/ ?/ l9 M" _8 {+ O9 U
npminstall@7.12.0 (C:\Users\admin\AppData\Roaming\npm\node_modules\cnpm\node_modules\npminstall\lib\index.js): s1 T) d1 y; ~2 y
prefix=C:\Program Files\nodejs. j  B, ]" |7 e0 r7 P
win32 x64 10.0.19045
3 O2 T$ k0 H, I* m9 h5 zregistry=https://registry.npmmirror.com! g* ?/ a, ]# e; s: M  B: X- `
PS C:\Users\admin\projects>
/ w$ |( }  v" f% |8 \( ~) @. h" D8 R- k2 Y; F, O0 M6 \

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
 楼主| 发表于 2025-7-29 10:22:55 | 显示全部楼层
#升级 npm. A6 z2 f1 O; u% U/ x5 t
cnpm install npm -g
: u# c' W# x/ u$ H
5 P% ?2 @4 t' s! t( N1 T5 ^2 q1 X7 |7 C6 A
# 升级或安装 cnpm
. w- F4 v# m1 k7 _npm install cnpm -g
您需要登录后才可以回帖 登录 | 注册

本版积分规则

返回首页|Archiver|手机版|小黑屋|易陆发现技术论坛 ( 蜀ICP备2026014127号-1 )

GMT+8, 2026-6-12 00:11 , Processed in 0.022546 second(s), 22 queries .

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表