|
|
报错信息:
2 t& j/ A" F& L5 X! G```bash3 j+ G" G. s5 E4 a4 w
gyp ERR! find VS
3 z( X8 C7 N9 C# C" L; ^gyp ERR! find VS msvs_version not set from command line or npm config5 Z! M! b3 J& t/ i" y D9 _: O
gyp ERR! find VS running in VS Command Prompt, installation path is:
- m# v, V9 B6 B6 B+ J' agyp ERR! find VS "C:\Program Files (x86)\Microsoft Visual Studio\2017"
6 n1 i2 Z1 r& x( f( [gyp ERR! find VS - will only use this version
y& L/ |& p4 V! s+ N9 J+ [7 ggyp ERR! find VS could not use PowerShell to find Visual Studio 2017 or newer
( ]) m% b0 n/ E. h# kgyp ERR! find VS looking for Visual Studio 2015* v3 t; H1 d' T
gyp ERR! find VS - not found+ e8 \- o5 T% l/ x, s2 b0 p" {% p2 z
gyp ERR! find VS looking for Visual Studio 2013
( L& ~0 d. ^# z% c/ M+ P& V& g5 Qgyp ERR! find VS - not found& a' k' T) N! j' Q2 o8 j
gyp ERR! find VS
& U( y; ?( O% k6 R7 Sgyp ERR! find VS **************************************************************
# m3 I3 @6 U' z. x i; Vgyp ERR! find VS You need to install the latest version of Visual Studio
3 S& s0 y \( l- {( @gyp ERR! find VS including the "Desktop development with C++" workload.: i7 Q: k/ J& ^/ y
gyp ERR! find VS For more information consult the documentation at:
( V2 D4 O+ P2 ggyp ERR! find VS https://github.com/nodejs/node-gyp#on-windows8 G8 _8 L; e0 z' y( w
gyp ERR! find VS **************************************************************
a, s$ t+ v) T3 m' p1 [gyp ERR! find VS
3 P0 t/ J5 J) B" f3 A& B% egyp ERR! configure error
! {) L/ `- W# R# Q7 e2 l% {9 g, bgyp ERR! stack Error: Could not find any Visual Studio installation to use! w' ^" K; ~5 x7 E7 }1 U
gyp ERR! stack at VisualStudioFinder.fail (D:\rymcu\electron-serialport\node_modules\node-gyp\lib\find-visualstu
" I; b2 P) e! K$ `/ Y4 W# ndio.js:121:47)) p3 C/ p) K) y9 R, S x% l
gyp ERR! stack at D:\rymcu\electron-serialport\node_modules\node-gyp\lib\find-visualstudio.js:74:16* p& ~2 E8 B; K+ \, H
gyp ERR! stack at D:\rymcu\electron-serialport\node_modules\node-gyp\lib\find-visualstudio.js:372:166 w" A3 U) V& D6 g; R7 B
gyp ERR! stack at D:\rymcu\electron-serialport\node_modules\node-gyp\lib\util.js:54:7% M7 I% w/ U7 b. \2 C. B+ j
gyp ERR! stack at D:\rymcu\electron-serialport\node_modules\node-gyp\lib\util.js:33:165 o3 h3 S$ L3 ]# k
gyp ERR! stack at ChildProcess.exithandler (child_process.js:310:5)3 A4 t( _- S, }; U }
gyp ERR! stack at ChildProcess.emit (events.js:315:20)2 m; _( @/ U3 {9 R
gyp ERR! stack at maybeClose (internal/child_process.js:1021:16)
8 g# p" e7 B* e/ Z0 u. L4 m: g! Jgyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)+ @6 ?1 b6 Y; E# S' g# B. V
gyp ERR! System Windows_NT 10.0.15063
5 d1 a2 I/ D" E0 g* W! U' U: }+ j1 L4 l5 s
解决办法
; [9 ^9 j# ?: C( q$ y6 d1、卸载nodejs重新安装一遍
9 [- q g3 b4 ~ V" @' `. J3 e. _: [% s
2、设置淘宝镜像 npm config set registry https://registry.npm.taobao.org
' O! G" _( [1 w& w( ]7 G o/ M
6 w8 Z4 G3 v6 a( g8 _& q: {3、安装nodejs所需的环境(Visual Studio XX、python什么鬼的),执行这个命令会自动检测并帮你安装好,npm install --g --production windows-build-tools9 U0 @7 Y' C& I
————————————————
2 h3 l9 ~) `7 H0 |8 @6 h( }版权声明:本文为CSDN博主「一点一滴成长」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。2 a' D& N6 k# Q
原文链接:https://blog.csdn.net/qq_39946015/article/details/127351920 |
|