ws运行项目出现node-sass版本不兼容问题

学习过程中导入的vue项目前端在package.json中运行npm失败:

Module build failed: Error: Node Sass does not yet support your current environment: Windows 64-bit with Unsupported runtime (64)
For more information on which environments are supported please see:
https://github.com/sass/node-sass/releases/tag/v4.7.2
    at module.exports (E:\jetbrain\ws\xc-ui-pc-teach1\xc-ui-pc-teach\node_modules\node-sass\lib\binding.js:13:13)
    at Object.<anonymous> (E:\jetbrain\ws\xc-ui-pc-teach1\xc-ui-pc-teach\node_modules\node-sass\lib\index.js:14:35)
    at Module._compile (internal/modules/cjs/loader.js:701:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
    at Module.load (internal/modules/cjs/loader.js:600:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
    at Function.Module._load (internal/modules/cjs/loader.js:531:3)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:22:18)
    at Object.<anonymous> (E:\jetbrain\ws\xc-ui-pc-teach1\xc-ui-pc-teach\node_modules\sass-loader\lib\loader.js:3:14)
    at Module._compile (internal/modules/cjs/loader.js:701:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
    at Module.load (internal/modules/cjs/loader.js:600:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
    at Function.Module._load (internal/modules/cjs/loader.js:531:3)
    at Module.require (internal/modules/cjs/loader.js:637:17)

 @ ./node_modules/vue-style-loader!./node_modules/css-loader?{"sourceMap":false}!./node_modules/vue-loader/lib/style-compiler?{"vue":true,"id":"d
ata-v-1340bee1","scoped":true,"hasInlineConfig":false}!./node_modules/sass-loader/lib/loader.js?{"sourceMap":false}!./node_modules/vue-loader/lib
/selector.js?type=styles&index=0&bustCache!./src/base/components/head.vue 4:14-395 13:3-17:5 14:22-403
 @ ./src/base/components/head.vue
 @ ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/selector.js?type=script&index=0&bustCache!./src/module/home/page/login.vue
 @ ./src/module/home/page/login.vue
 @ ./src/module/home/router/index.js
 @ ./src/base/router/index.js
 @ ./src/main.js
 @ multi (webpack)-dev-server/client?http://localhost:12000 webpack/hot/dev-server ./src/main.js

这里显示的是:

Node Sass does not yet support your current environment: Windows 64-bit with Unsupported runtime (64)

Node-sass版本不兼容问题,这时,可以查看node版本,在项目地址中打开命令窗口

node -v

查询node版本
然后根据node查询配套node-sass版本

下面两条命令任选其一执行安装即可,主要是包管理器不同

npm i node-sass@4.14.1 sass-loader@7.3.1 --save-dev

yarn add node-sass@4.14.1 sass-loader@7.3.1 -D

这里的版本是我个人的,不同的node版本@后缀不同.
另附上node各版本对应的可用node-sass版本

在这里插入图片描述

如果报下面的错误:

Error from chokidar (D:\): Error: EBUSY: resource busy or locked, lstat ‘D:\pagefile.sys‘

按下面的两种办法操作即可:

1.删除 node_modules,再重新进行安装需要的依赖包(npm install 或者 cnpm install);
在这个过程中npm 的下载可能不大顺利,我这里显示有一个http 404,所以可以跳过这一步,直接取github上面下载相关的npm

2.删除 node_modules ,然后运行npm cache clean 或者npm cache clean --force;再重新安装需要的依赖包(重点)

参考了下面两篇博文:

node16.0版本 对应node-sass sass-loader 各个版本号_注定成为前端大牛的男人的博客-CSDN博客_nodesass对应node版本

Error from chokidar (D:): Error: EBUSY: resource busy or locked, lstat ‘D:\pagefile.sys‘_桃子味的猫的博客-CSDN博客

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值