当前位置:首页 > 经验笔记 > VUE > 正文内容

vue 项目运行node-sass报错

han32682年前 (2023-06-19)VUE2734
  • 报错信息

Browserslist: caniuse-lite is outdated. Please run:
  npx browserslist@latest --update-db
  Why you should do it regularly: https://github.com/browserslist/browserslist#browsers-data-updating
 INFO  Starting development server...
 WARN  A new version of sass-loader is available. Please upgrade for best experience.
98% after emitting CopyPlugin

 ERROR  Failed to compile with 1 error                                                                          
 error  in ./src/views/views.vue?vue&type=style&index=0&id=7f4cd9c4&lang=scss&scoped=true&

Syntax Error: Error: `sass-loader` requires `node-sass` >=4. Please install a compatible version.

    大概说的是sass 版本不匹配 

  • 解决方法先卸载现有的sass版本

npm i -D node-sass
  • 再安装依赖版本

npm rebuild node-sass
  •  node 和node-sass版本对应表格


f754ed2f8f14437ca76621f558d615e7.png


扫描二维码推送至手机访问。

版权声明:本文由瀚文博客发布,如需转载请注明出处。

本文链接:https://www.hanwenblog.com/post/83.html

分享给朋友:

相关文章

在vue中实现element-ui的el-dialog弹框拖拽

1.在assets/js/文件夹下新建directives.js 文件:import Vue from 'vue' // v-dialog...

vue跳转时打开新窗口的方法

    1、<vue-link>标签实现新窗口打开    官方文档中说 v-link 指令被 <rou...

vue 用webpack 打包的时候添加版本号, VUE 项目更新部署时,浏览器页面缓存问题

因浏览器缓存原因导致vue 打包的文件 导致偶尔会出现不能即使更新最新代码。因此在打包的文件名中添加一个版本号以便浏览器能区分。module.exports = {  ...

基于Vue的移动端图片裁剪组件(Clipic)可自动压缩

基于Vue的移动端图片裁剪组件(Clipic)可自动压缩

安装:Bashnpm install --save clipic使用代码:Markup<template>     ...

基于Vue的移动端图片裁剪组件(vue-imgcut)

基于Vue的移动端图片裁剪组件(vue-imgcut)

安装:npm install vue-imgcut –save使用代码:<template>     <div...