|
|
报错信息:
* y& z8 a+ V ^3 e```bash ^# N$ y& h7 g- A# i4 ^
gyp ERR! find VS
+ s& T, C8 B6 a. U) {6 _) c( m% b: k" k9 ~gyp ERR! find VS msvs_version not set from command line or npm config
) M) }. W1 Z; y$ E% A3 y+ Egyp ERR! find VS running in VS Command Prompt, installation path is:2 L2 n6 S3 [9 q2 t
gyp ERR! find VS "C:\Program Files (x86)\Microsoft Visual Studio\2017"
) ~1 J. ?8 h. @gyp ERR! find VS - will only use this version
6 I9 {# J( i+ X& z9 Y$ Agyp ERR! find VS could not use PowerShell to find Visual Studio 2017 or newer& S# z2 P6 u( K! c. E# P# {! D
gyp ERR! find VS looking for Visual Studio 2015$ X! F F% O! ]( m0 q8 w4 u
gyp ERR! find VS - not found0 }! N" j0 H& l+ I4 E5 @$ [; X) }
gyp ERR! find VS looking for Visual Studio 2013& r) A! C" Z8 V w5 I5 ~
gyp ERR! find VS - not found U# i) k. G2 I1 G
gyp ERR! find VS
* E |7 Y+ B/ E" i" L* B- m# V/ R8 ogyp ERR! find VS **************************************************************' A9 G- @: O& \# c# I& p" N
gyp ERR! find VS You need to install the latest version of Visual Studio
& s* K# j6 F0 C1 T" G" K, ngyp ERR! find VS including the "Desktop development with C++" workload.
! H: k! [) c& `4 y+ N2 r8 Z/ ~gyp ERR! find VS For more information consult the documentation at:/ R" O0 H: o5 O2 z; p
gyp ERR! find VS https://github.com/nodejs/node-gyp#on-windows
; G% J+ `5 W/ a- Lgyp ERR! find VS **************************************************************
& c/ n% @5 {7 D' r3 Hgyp ERR! find VS
" K' a/ u' B% \6 ^$ d5 lgyp ERR! configure error
9 u7 \' w9 K0 S! w8 [% ^gyp ERR! stack Error: Could not find any Visual Studio installation to use
* n: P$ x3 f3 A& i4 @gyp ERR! stack at VisualStudioFinder.fail (D:\rymcu\electron-serialport\node_modules\node-gyp\lib\find-visualstu
% l; V5 t6 O) c, cdio.js:121:47)* N+ Q; G% f$ a6 b
gyp ERR! stack at D:\rymcu\electron-serialport\node_modules\node-gyp\lib\find-visualstudio.js:74:16; ], \4 l$ _- v L, N
gyp ERR! stack at D:\rymcu\electron-serialport\node_modules\node-gyp\lib\find-visualstudio.js:372:16- {8 B5 ?# [5 v; v+ U0 E
gyp ERR! stack at D:\rymcu\electron-serialport\node_modules\node-gyp\lib\util.js:54:70 q# X5 J5 X; F9 h0 Q+ c( A! v9 [1 v
gyp ERR! stack at D:\rymcu\electron-serialport\node_modules\node-gyp\lib\util.js:33:16
+ P; k+ A% }+ agyp ERR! stack at ChildProcess.exithandler (child_process.js:310:5)
6 E9 ?* |; b' g; h0 |gyp ERR! stack at ChildProcess.emit (events.js:315:20)% [6 T f, R; q$ o0 K, E
gyp ERR! stack at maybeClose (internal/child_process.js:1021:16)
& S3 t+ H8 L+ `6 c4 Dgyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
* ?* G7 v' r2 ]. G8 S6 k4 tgyp ERR! System Windows_NT 10.0.15063
0 R, g4 I0 i7 w9 o# N7 ^0 N- f w( U
解决办法8 B& {+ F. D' B/ l
1、卸载nodejs重新安装一遍
$ ^ v/ Q$ l9 S) y6 `( f( ~& P4 r3 |* X6 K& R
2、设置淘宝镜像 npm config set registry https://registry.npm.taobao.org- s) h0 F8 M9 W3 y
4 W1 L: h! @, k4 j0 D. ?+ L3、安装nodejs所需的环境(Visual Studio XX、python什么鬼的),执行这个命令会自动检测并帮你安装好,npm install --g --production windows-build-tools
% @% y* c! S0 s* o+ u5 ?- ~4 M' K————————————————
8 n4 O" `( M5 t4 w版权声明:本文为CSDN博主「一点一滴成长」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。* E* z& ]) f8 s
原文链接:https://blog.csdn.net/qq_39946015/article/details/127351920 |
|