栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > C/C++/C#

Vue前端npm编译报错问题总结

C/C++/C# 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

Vue前端npm编译报错问题总结

  Vue框架可以很方便的引入各种插件,但是也因此会经常遇到种编译报错,解决起来很耗时,现在将平时遇到的一些编译报错,以及解决方法收录于此。

1、Module build failed: Error: Cannot find module 'node-sass'

问题:

Module build failed: Error: Cannot find module 'node-sass'

Module build failed: Error: Node Sass does not yet support your current environment: Windows 64-bit with Unsupported runtime (83)
For more information on which environments are supported please see:
https://github.com/sass/node-sass/releases/tag/v4.13.0

以上问题在解决的过程中,期间可能会变形的出现其它与之相关的各种问题,但报这种问题的根源可能是本地环境原因。主要是由于本地的nodejs版本与node-sass的版本不匹配兼容。

解决方法:

  1. 查看报错中的地址https://github.com/sass/node-sass/releases/tag/v4.13.0,得到以下版本兼容关系:
    从上图可以看出,node-sass4.13.0支持的nodejs版本最高为13,而我本地环境版本是14,所以我本机出现以上报错;
  2. 降级nodejs版本,改为node-v10.16.0-x64.msi(有需要的可以留言,可以分享下网盘下载);
  3. 卸载14版本,安装10版本;
  4. 完成以上安装,需要对node-sass进行重新编译 npm rebuild node-sass,否则无法与10版本node进行绑定,会如下错误:


    Module build failed: Error: Missing binding D:CompCodeProdit-portalsrcfenode_modules_node-sass@4.13.0@node-sassvendorwin32-x64
    -64binding.node
    Node Sass could not find a binding for your current environment: Windows 64-bit with Node.js 10.x

    Found bindings for the following environments:
      - Windows 64-bit with Unsupported runtime (83)

    This usually happens because your environment has changed since running `npm install`.
    Run `npm rebuild node-sass` to download the binding for your current environment.

  5. 完成以上步骤,则可以进行npm run dev。

2、MSBUILD : error MSB3428: 未能加载 Visual C++ 组件“VCBuild.exe”

问题:

MSBUILD : error MSB3428: 未能加载 Visual C++ 组件“VCBuild.exe”。要解决此问题,1) 安装 .NET framework 2.0 SDK;2) 安装 Microsoft Visual Stu

解决方法:

npm install --global --production windows-build-tools

 

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/698307.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号