Vue 專案出現 Node Sass could not find a binding for your current environment

前言

最近在弄 Vue Cli 2 專案的時候突然發生一個錯誤,Node Sass could not find a binding for your current environment,所以這一篇記錄一下該如何解決。

問題

由於該專案是 Vue Cli 2,所以當我執行 npm start 時卻出現以下錯誤

1
2
3
4
5
6
7
8
Module build failed: Error: Missing binding D:\vue\node_modules\node-sass\vendor\win32-x64-67\binding.node
Node Sass could not find a binding for your current environment: Windows 64-bit with Node.js 11.x

Found bindings for the following environments:
- OS X 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.

解決方法

解決方法其實很簡單 ,只需要在該專案下執行 npm rebuild node-sass 就可以了,至於問題點是 node-sass 版本安裝上的錯誤導致。

參考文獻

Node Sass couldn’t find a binding for your current environment

0%