|
|
报错信息:
, L) q# m7 }. w- j& r& E2 v```bash
, w9 a+ A) q6 n$ a4 X( Ogyp ERR! find VS1 Y, q' O, H/ u5 y+ T* S* T
gyp ERR! find VS msvs_version not set from command line or npm config
: G) O7 r. x- E) m' F; ]# T# S) Bgyp ERR! find VS running in VS Command Prompt, installation path is:0 c7 P- J$ [2 n
gyp ERR! find VS "C:\Program Files (x86)\Microsoft Visual Studio\2017"% S7 A1 X3 w2 a7 J) x
gyp ERR! find VS - will only use this version
1 \. S$ T' A# @, mgyp ERR! find VS could not use PowerShell to find Visual Studio 2017 or newer( {% k/ x2 t' A, S% a
gyp ERR! find VS looking for Visual Studio 2015
& d# W: c' x! S" t; Mgyp ERR! find VS - not found
9 e, \% M2 g2 U2 {9 lgyp ERR! find VS looking for Visual Studio 20130 Y U$ k( s9 P I: w
gyp ERR! find VS - not found
/ _% w0 l! ?2 V9 K: t# z6 Ygyp ERR! find VS# S4 B6 V, M/ j8 b
gyp ERR! find VS **************************************************************
, G+ E2 m( t, R4 f0 @6 R9 }: [gyp ERR! find VS You need to install the latest version of Visual Studio1 w9 C# p0 j' ?; N( F. ]# z' P
gyp ERR! find VS including the "Desktop development with C++" workload.
( [( N( K( C* q- ~+ a) Ugyp ERR! find VS For more information consult the documentation at:+ z6 X% T, o/ i2 c: E& s0 B1 V
gyp ERR! find VS https://github.com/nodejs/node-gyp#on-windows5 q8 V) B. `- x+ X! p9 k) ~ v
gyp ERR! find VS **************************************************************
) E- Y4 Z- J8 m, w i7 n( r- O4 ngyp ERR! find VS9 a( H, [/ T: n- A9 T
gyp ERR! configure error1 v9 P x) a; A( S
gyp ERR! stack Error: Could not find any Visual Studio installation to use7 H/ d+ S0 L! q( M7 }
gyp ERR! stack at VisualStudioFinder.fail (D:\rymcu\electron-serialport\node_modules\node-gyp\lib\find-visualstu
: V& H0 B# E( S* }; J udio.js:121:47); u0 P4 H, m* L! R$ F5 x9 H% v
gyp ERR! stack at D:\rymcu\electron-serialport\node_modules\node-gyp\lib\find-visualstudio.js:74:162 G# v; l- `: i: f1 W* k- s( S. c
gyp ERR! stack at D:\rymcu\electron-serialport\node_modules\node-gyp\lib\find-visualstudio.js:372:16
# V* I. }. f+ s: z7 F( b; |gyp ERR! stack at D:\rymcu\electron-serialport\node_modules\node-gyp\lib\util.js:54:7+ ]+ w7 E* y3 S3 o `* G7 T
gyp ERR! stack at D:\rymcu\electron-serialport\node_modules\node-gyp\lib\util.js:33:16# U: B; y& U( O* C
gyp ERR! stack at ChildProcess.exithandler (child_process.js:310:5)* \. m# n" o4 r E( T( N% h5 p X
gyp ERR! stack at ChildProcess.emit (events.js:315:20)# _3 f7 F+ A6 F0 ~
gyp ERR! stack at maybeClose (internal/child_process.js:1021:16)" a+ M; Y6 Y% z8 a) d
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)$ R" a) A- m% Q! E% Y8 `6 n4 Y
gyp ERR! System Windows_NT 10.0.15063 5 d& Q' ~! e% V# t8 Z9 v
5 j5 }5 O$ }( U4 ?" P4 T
解决办法
& m7 Y& s! I. u6 G3 \1、卸载nodejs重新安装一遍% c" w7 O F2 A& ]0 Y, O: I
4 Z1 N: h2 p7 G4 W! s: J' V2、设置淘宝镜像 npm config set registry https://registry.npm.taobao.org% T7 r- l# n2 p% y
5 R9 B# z, I+ k, o4 k+ q ~
3、安装nodejs所需的环境(Visual Studio XX、python什么鬼的),执行这个命令会自动检测并帮你安装好,npm install --g --production windows-build-tools
$ k# Q4 W! g, Z, S/ i) j- e, ]$ ?: M————————————————
; Z" L# Q6 S/ i. ^4 }2 f版权声明:本文为CSDN博主「一点一滴成长」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。6 P% r& v$ I! _/ \$ L2 h# N
原文链接:https://blog.csdn.net/qq_39946015/article/details/127351920 |
|