npm install各种报错

本文记录了在Windows环境下使用npm安装node-sass模块时遇到的问题及解决方案。主要问题是未能找到可用的Visual Studio安装,导致node-sass构建失败。文章提供了详细的错误日志,并推荐了安装最新版Visual Studio(包括桌面开发C++负载)作为解决方案。

安装项目时各种报错
在这里插入图片描述


npm ERR! code 1
npm ERR! path E:\项目\完整\谷粒商城\renren-fast-vue\node_modules inode-sassnpm ERR! command failed
npm ERR! command C: Windows\system32\cmd.exe /d /s /c node-gyp rebuildnpm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@7.1.2
npm ERR! gyp info using node@16.11.1 | win32 x64
npm ERR! gyp info find Python using Python version 3.8.8 found at "D:\code\Python\Python38\python.exe""npm ERR! gyp ERR! find vs
npm ERR! gyp ERR! find Vs msvs_version not set from command line or npm confignpm ERR! gyp ERR! find VS VCINSTALLDIR not set,not running in Vs Command Prompt
pm ERl gyp ER! find VS could not use PowerShell to find Visual Studio 2017or neuer, try re-rumning with ' --loglevel silly' for mre detailsnpm ERR! gyp ERR! find vS looking for Visual Studio 2015
npm ERR! gyp ERR! find vs - not found
npm ERR! gyp ERR! find V5 not looking for VS2013 as it is only supported up to Node.js 8npm ERR! gyp ERR! find vs
npm ERR! gyp ERR! find VS **容赛寒寒寐睿睿客客寒零寐寐寒寒寐寐寒零寐寐寒寒寒寐察寒寒家家寐寒零家容寐寒零家家容零*家家容容***家家撺容琢琢零零家*npm ERR! gyp ERR! find Vs You need to install the latest version of Visual Studio
npm ERR! gyp ERR! find Vs including the"Desktop development with Ct" workload.npm ERR! gyp ERR! find VS For more information consult the documentation at:
npm ERR! gyp ERR! find Vs https://github.com/nodejs/node-gyp#on-windows
npm ERR! gyp ERR! find VS *容寒零家容寒球寐寐寒家容*家家容骞家家容*琢寐半*零零家容皋寐零寒寐裸零零零容零骞寒零零享骞零水零零窜霉骞***家容享**npm ERR! gyp ERR! find vs
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: Could not find any Visual Studio installation to use
nom ER gyp ER! stack at VisualStudioFinder.fail (E:项目\完整谷拉商城'renwen-fast-vuelnode motuleslorde-gplitlfind-vistalstutio.j:121:47)npm ERR! gyp ERR! stack at E:\项目\完整\谷粒商城\renren-fast-vuelnode modules lnode-gypliblfind-visualstudio.js:74:16
npm ER! gyp ERA! stackat VisualStutioFinder .finNVisualstudio&13 (E:v项目完整谷拉商城venmen-fast-vuelyode mobileslnde-gpli find-visalstutio.js:51.14)npm ERR! gyp ER stack at E:\项目\完整Y谷粒商城\renren-fast-vue(node modules \node-gypNlib\find-visualstudio. j5:78:14
npm ERR! gyp ERR! stack at E:\项目\完整\谷粒商城\renren-fast-vuelnode modules lnode-gypliblfind-visualstudio.j5:372:16npm ERR! gyp ERR! stack at E:\项目\完整\谷粒商城\renren-fast-vue[node moduleslnode-gyp\liblutil.js:54:7
npm ERR! Byp ER stack atE:\项目\完整\谷粒商城\renren-fast-vue\node_modules(node-gyp\lib\util.js:33:16
npm ERR! gyp ERR! stack at ChildProcess.exithandler (node:child_process:404:5)
npm ERR! gyp ERR! stackat ChildProcess.emit (node:events:390:28)
npm ERR! gyp ERR! stack at maybeClose (node:internal/child_process:1064:16)npm ERR! gyp ERR! System windows_NT16.8.19844
npm ER! gp ERA! comand "D:I[codellrodejs [ode.exe""E:项目\完整I谷粒商城\Irenren-fast-wue[[node moulesl[node-gplbin(Irod-gp.js""rebuildnpm ERR! gyp ERR! awd E:\项目\完整\谷粒商城\renren-fast-vue\node_modules \node-sass
npm ERR! gyp ERR! node -v v16.11.1
npm ERR!gyp ERR! node-gyp -v v7.1.2npm ERR! gyp ERR! not ok

https://github.com/nodejs/node-gyp#on-windows

安装这个完美解决

在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值