|
|
报错信息:
- B0 r+ m% [# _8 n- a```bash
$ p. n/ l5 }8 C3 A/ C; p& v9 Cgyp ERR! find VS
4 A! M2 V' G. \* |# F/ ogyp ERR! find VS msvs_version not set from command line or npm config
% }6 `8 Q, J; C' {6 F4 vgyp ERR! find VS running in VS Command Prompt, installation path is:
i7 w! ~) t; X+ qgyp ERR! find VS "C:\Program Files (x86)\Microsoft Visual Studio\2017"
, A& D2 I+ e: l1 o4 Z- } S" Xgyp ERR! find VS - will only use this version
7 K9 V0 ~2 P3 k. l& y xgyp ERR! find VS could not use PowerShell to find Visual Studio 2017 or newer
/ _; J Y, `# i3 z. mgyp ERR! find VS looking for Visual Studio 2015
S8 a% O+ f) q% ^5 Dgyp ERR! find VS - not found4 L" j9 F' C0 o1 Q9 q& G) r1 u
gyp ERR! find VS looking for Visual Studio 2013
7 d( ]+ @4 H2 k# M0 C* Lgyp ERR! find VS - not found% h; }0 B8 U/ ^8 h7 t! i
gyp ERR! find VS
. z: Y# l% r2 i5 [; Y- a5 W/ Vgyp ERR! find VS **************************************************************% Q/ X: c O7 N( S: T, v
gyp ERR! find VS You need to install the latest version of Visual Studio/ d- ]% t. S% d/ R5 K
gyp ERR! find VS including the "Desktop development with C++" workload.
3 f$ O4 W& O! ]$ y6 e7 }$ Agyp ERR! find VS For more information consult the documentation at:, k/ V+ B; z4 ~
gyp ERR! find VS https://github.com/nodejs/node-gyp#on-windows
7 c$ g: S" i. f2 W& M( X, Tgyp ERR! find VS **************************************************************. N3 d9 p& i. t5 M& k. E
gyp ERR! find VS8 F2 q* t2 D( X- }0 Y
gyp ERR! configure error7 s4 N1 e% u) m5 q: `' x- s
gyp ERR! stack Error: Could not find any Visual Studio installation to use
# ? ?' T$ B& F" x, n% ggyp ERR! stack at VisualStudioFinder.fail (D:\rymcu\electron-serialport\node_modules\node-gyp\lib\find-visualstu- f1 T# b* b% _
dio.js:121:47)7 d3 @' V5 l0 ]4 Z$ i" i, u
gyp ERR! stack at D:\rymcu\electron-serialport\node_modules\node-gyp\lib\find-visualstudio.js:74:16( @5 \0 b1 o6 q/ E4 D; |1 V2 w% |
gyp ERR! stack at D:\rymcu\electron-serialport\node_modules\node-gyp\lib\find-visualstudio.js:372:16
% q) o# _* B" F# Zgyp ERR! stack at D:\rymcu\electron-serialport\node_modules\node-gyp\lib\util.js:54:7# J4 n ~* U. n- j) E. y; w4 O3 X
gyp ERR! stack at D:\rymcu\electron-serialport\node_modules\node-gyp\lib\util.js:33:16, Y( q( z: E7 n* b: q1 I
gyp ERR! stack at ChildProcess.exithandler (child_process.js:310:5)
' B: Z; D% k8 p' ?gyp ERR! stack at ChildProcess.emit (events.js:315:20)
. O2 m. W1 \5 P) B% O; _- fgyp ERR! stack at maybeClose (internal/child_process.js:1021:16)0 B" V. K( f* ~ z6 X% |
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
1 ^# Q7 h' c1 B4 N# Mgyp ERR! System Windows_NT 10.0.15063 $ A! A9 a0 V, K: r
. e9 }- ~8 `# r解决办法4 Z# P1 U& \8 W; N
1、卸载nodejs重新安装一遍
( U# Z! R" h4 O& |( k5 ~; r6 T @4 ^0 c L# f' y
2、设置淘宝镜像 npm config set registry https://registry.npm.taobao.org% x1 |6 c0 K) n: X
% h7 j2 ?9 C; X3 K& |( F
3、安装nodejs所需的环境(Visual Studio XX、python什么鬼的),执行这个命令会自动检测并帮你安装好,npm install --g --production windows-build-tools/ p1 s7 I$ S9 [ ]; r' h% B: z! Z
————————————————
' c+ v X4 D) Y! c; l- P版权声明:本文为CSDN博主「一点一滴成长」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
6 e* ~8 @: P$ M' W h原文链接:https://blog.csdn.net/qq_39946015/article/details/127351920 |
|