人人开源前端框架报错解决方案

step1

cnpm install

报错

gyp ERR! find VS
gyp ERR! find VS msvs_version not set from command line or npm config
gyp ERR! find VS VCINSTALLDIR not set, not running in VS Command Prompt
gyp ERR! find VS could not use PowerShell to find Visual Studio 2017 or newer, try re-running with '--loglevel silly' for more details
gyp ERR! find VS looking for Visual Studio 2015
gyp ERR! find VS - not found
gyp ERR! find VS not looking for VS2013 as it is only supported up to Node.js 8
gyp ERR! find VS
gyp ERR! find VS **************************************************************
gyp ERR! find VS You need to install the latest version of Visual Studio
gyp ERR! find VS including the "Desktop development with C++" workload.
gyp ERR! find VS For more information consult the documentation at:
gyp ERR! find VS https://github.com/nodejs/node-gyp#on-windows
gyp ERR! find VS **************************************************************
gyp ERR! find VS
gyp ERR! configure error
gyp ERR! stack Error: Could not find any Visual Studio installation to use
gyp ERR! stack     at VisualStudioFinder.fail (D:\研究生阶段学习\其他\规划\谷粒商城\renren-fast-vue-master\node_modules\_node-gyp@7.1.2@node-gyp\lib\find-visualstudio.js:121:47)
gyp ERR! stack     at D:\研究生阶段学习\其他\规划\谷粒商城\renren-fast-vue-master\node_modules\_node-gyp@7.1.2@node-gyp\lib\find-visualstudio.js:74:16
gyp ERR! stack     at VisualStudioFinder.findVisualStudio2013 (D:\研究生阶段学习\其他\规划\谷粒商城\renren-fast-vue-master\node_modules\_node-gyp@7.1.2@node-gyp\lib\find-visualstudio.js:351:14)
gyp ERR! stack     at D:\研究生阶段学习\其他\规划\谷粒商城\renren-fast-vue-master\node_modules\_node-gyp@7.1.2@node-gyp\lib\find-visualstudio.js:70:14
gyp ERR! stack     at D:\研究生阶段学习\其他\规划\谷粒商城\renren-fast-vue-master\node_modules\_node-gyp@7.1.2@node-gyp\lib\find-visualstudio.js:372:16
gyp ERR! stack     at D:\研究生阶段学习\其他\规划\谷粒商城\renren-fast-vue-master\node_modules\_node-gyp@7.1.2@node-gyp\lib\util.js:54:7
gyp ERR! stack     at D:\研究生阶段学习\其他\规划\谷粒商城\renren-fast-vue-master\node_modules\_node-gyp@7.1.2@node-gyp\lib\util.js:33:16
gyp ERR! stack     at ChildProcess.exithandler (node:child_process:420:5)
gyp ERR! stack     at ChildProcess.emit (node:events:513:28)
gyp ERR! stack     at maybeClose (node:internal/child_process:1091:16)
gyp ERR! System Windows_NT 10.0.22000
gyp ERR! command "E:\\nodejs\\node.exe" "D:\\研究生阶段学习\\其他\\规划\\谷粒商城\\renren-fast-vue-master\\node_modules\\_node-gyp@7.1.2@node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd D:\研究生阶段学习\其他\规划\谷粒商城\renren-fast-vue-master\node_modules\_node-sass@6.0.1@node-sass
gyp ERR! node -v v18.12.1
gyp ERR! node-gyp -v v7.1.2
gyp ERR! not ok

解决方案

cnpm config set msvs_version 2022

step2

cnpm run dev

报错

 ERROR  Failed to compile with 6 errors         01:03:23

 error  in ./src/assets/scss/index.scss

Module build failed: Error: Node Sass does not yet support your current environment: Windows 64-bit with Unsupported runtime (108)
For more information on which environments are supported please see:
https://github.com/sass/node-sass/releases/tag/v6.0.1
    at module.exports (D:\研究生阶段学习\其他\规划\谷粒商城\renren-fast-vue-master\node_modules\_node-sass@6.0.1@node-sass\lib\binding.js:13:13)
    at Object.<anonymous> (D:\研究生阶段学习\其他\规划\谷粒商城\renren-fast-vue-master\node_modules\_node-sass@6.0.1@node-sass\lib\index.js:13:35)
    at Module._compile (node:internal/modules/cjs/loader:1159:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1213:10)
    at Module.load (node:internal/modules/cjs/loader:1037:32)
    at Module._load (node:internal/modules/cjs/loader:878:12)
    at Module.require (node:internal/modules/cjs/loader:1061:19)
    at require (node:internal/modules/cjs/helpers:103:18)
    at Object.<anonymous> (D:\研究生阶段学习\其他\规划\谷粒商城\renren-fast-vue-master\node_modules\_sass-loader@6.0.6@sass-loader\lib\loader.js:3:14)
    at Module._compile (node:internal/modules/cjs/loader:1159:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1213:10)
    at Module.load (node:internal/modules/cjs/loader:1037:32)
    at Module._load (node:internal/modules/cjs/loader:878:12)
    at Module.require (node:internal/modules/cjs/loader:1061:19)
    at require (node:internal/modules/cjs/helpers:103:18)
    at loadLoader (D:\研究生阶段学习\其他\规划\谷粒商城\renren-fast-vue-master\node_modules\_loader-runner@2.4.0@loader-runner\lib\loadLoader.js:18:17)

解决方案

  • 原因是sass版本太低
  • 1.进入node_modules目录,将node-sass文件夹删除
  • 2.执行
cnpm i node-sass --sass_binary_site=https://npm.taobao.org/mirrors/node-sass/

step3

run

cnpm run dev

成功

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

CtrlZ1

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值