vue项目依赖包加载问题:Run `npm rebuild node-sass` to download the binding for your current environment.


 error  in ./src/views/createResume.vue?vue&type=style&index=0&lang=scss&

Module build failed (from ./node_modules/sass-loader/dist/cjs.js):
Error: Missing binding c:\Users\Administrator\Desktop\vue-study-master\vue-study-master\node_modules\node-sass\vendor\win32-x64-72\binding.node
Node Sass could not find a binding for your current environment: Windows 64-bit with Node.js 12.x

Found bindings for the following environments:
  - Windows 64-bit with Node.js 12.x

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.
    at module.exports (c:\Users\Administrator\Desktop\vue-study-master\vue-study-master\node_modules\node-sass\lib\binding.js:15:13)
    at Object.<anonymous> (c:\Users\Administrator\Desktop\vue-study-master\vue-study-master\node_modules\node-sass\lib\index.js:14:35)
    at Module._compile (internal/modules/cjs/loader.js:1156:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1176:10)
    at Module.load (internal/modules/cjs/loader.js:1000:32)
    at Function.Module._load (internal/modules/cjs/loader.js:899:14)
    at Module.require (internal/modules/cjs/loader.js:1042:19)
    at require (internal/modules/cjs/helpers.js:77:18)
    at getDefaultSassImplementation (c:\Users\Administrator\Desktop\vue-study-master\vue-study-master\node_modules\sass-loader\dist\getDefaultSassImplementation.js:24:10)
    at getSassImplementation (c:\Users\Administrator\Desktop\vue-study-master\vue-study-master\node_modules\sass-loader\dist\getSassImplementation.js:19:72)
    at Object.loader (c:\Users\Administrator\Desktop\vue-study-master\vue-study-master\node_modules\sass-loader\dist\index.js:40:61)

 @ ./node_modules/vue-style-loader??ref--8-oneOf-1-0!./node_modules/css-loader/dist/cjs.js??ref--8-oneOf-1-1!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src??ref--8-oneOf-1-2!./node_modules/sass-loader/dist/cjs.js??ref--8-oneOf-1-3!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/views/createResume.vue?vue&type=style&index=0&lang=scss& 4:14-443 14:3-18:5 15:22-451
 @ ./src/views/createResume.vue?vue&type=style&index=0&lang=scss&
 @ ./src/views/createResume.vue
 @ ./src/router/router.js
 @ ./src/main.js
 @ multi (webpack)-dev-server/client?http://192.168.50.58:8080/sockjs-node (webpack)/hot/dev-server.js ./src/main.js

项目加载依赖包时,sass依赖包一直加载不了,第二次跑npm i 又没有显示问题,等跑项目的时候直接抛出下面错误,

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.

大概意思是在npm install的时候包发生变化,需要重新下载node-sass依赖

然后我根据上面给的提示npm rebuild node-sass --force进行单独加载sass依赖,结果就是一直加载完,等了好几分钟。

果断用了淘宝镜像进行加载 cnpm install node-sass ;结果秒载。

最后回到终端试了npm run serve项目成功跑起来 ,前提你要配置淘宝镜像:打开命令提示符输入node -v,可以看是否安装成功,然后再npm install cnpm -g --registry=https://registry.npm.taobao.org

虽然不是什么难问题,但是对于刚用vue没多久的朋友经常会遇到依赖包加载不了的问题,所以建议有遇到依赖包加载问题,npm 不行就用cnpm, 多试几个办法。

  • 2
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
"Node Sass could not find a binding for your current environment: Windows 64-bit with Node.js 12.x" 这个错误通常是因为你的项目中使用的 node-sass 版本与当前的 Node.js 版本不兼容导致的。 当你升级了 Node.js 到 12.x 版本后,原来项目中的 node-sass 版本可能过低,无法找到与当前环境兼容的 binding。这个问题可以通过更新或重新安装 node-sass 来解决。你可以先尝试在项目目录下执行以下命令来重新安装 node-sass: ```bash npm rebuild node-sass ``` 如果重新安装仍然无法解决问题,那么可能需要升级你的 node-sass 版本。你可以通过以下命令来更新 node-sass: ```bash npm install node-sass@latest ``` 这样就会安装最新版本的 node-sass,它应该与你当前的 Node.js 版本兼容。如果你还是遇到问题,请确保你的 Node.js 版本与你使用的 node-sass 版本兼容,并尝试重新安装或更新 node-sass。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *3* [Node Sass could not find a binding for your current environment: Windows 64-bit with Node.js](https://blog.csdn.net/pidanl/article/details/127364519)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] - *2* [vue项目从node8.x升级到12.x后的问题解决](https://download.csdn.net/download/weixin_38522106/13676445)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值