发过光的男人 發表於 2020-10-11 22:44:00

npm报错:Node Sass could not find a binding for your current environment: Windows 64-bit with Node.js 10.x

<blockquote>
<p>npm报错:Node Sass does not yet support your current environment: Windows 64-bit with Unsupported runtime</p>
</blockquote>
<h3 id="异常信息">异常信息</h3>
<pre><code>Module build failed: Error: Missing binding D:\wps工单系统\wps\node_modules\node-sass\vendor\win32-x64-64\binding.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 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 (D:\wps工单系统\wps\node_modules\node-sass\lib\binding.js:15:13)
    at Object.&lt;anonymous&gt; (D:\wps工单系统\wps\node_modules\node-sass\lib\index.js:14:35)
    at Module._compile (internal/modules/cjs/loader.js:776:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Module.require (internal/modules/cjs/loader.js:690:17)
    at require (internal/modules/cjs/helpers.js:25:18)
    at Object.sassLoader (D:\wps工单系统\wps\node_modules\sass-loader\lib\loader.js:46:72)

@ ./node_modules/vue-style-loader!./node_modules/css-loader?{"sourceMap":true}!./node_modules/vue-loader/lib/style-compiler?{"optionsId":"0","vue":true,"id":"data-v-f076e348","scoped":true,"sourceMap":true}!./node_modules/sass-loader/lib/loader.js?{"sourceMap":true}!./node_modules/vue-loader/lib/selector.js?type=styles&amp;index=0!./src/element-rx/components/Index/MainCenter/Lesson1.vue 4:14-423 13:3-17:5 14:22-431
@ ./src/element-rx/components/Index/MainCenter/Lesson1.vue
@ ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/selector.js?type=script&amp;index=0!./src/element-rx/components/Index/MainCenter/MainCenter.vue
@ ./src/element-rx/components/Index/MainCenter/MainCenter.vue
@ ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/selector.js?type=script&amp;index=0!./src/element-rx/components/Index/Index.vue
@ ./src/element-rx/components/Index/Index.vue
@ ./src/element-rx/coreRouter/index.js
@ ./src/router/index.js
@ ./src/main.js
@ multi (webpack)-dev-server/client?http://localhost:8080 webpack/hot/dev-server ./src/main.js babel-polyfill

</code></pre>
<p>之前使用 Node.js 8 创建的 vue 项目,升级 Node.js 12 后,执行&nbsp;npm run serve&nbsp;后报错。删除 node_modules 目录,重新执行&nbsp;npm install&nbsp;和&nbsp;npm rebuild&nbsp;后都没有解决。</p>
<h3 id="解决方法">解决方法</h3>
<p>卸载旧版本 node-sass 并安装最新版本</p>
<pre><code>npm uninstall --save node-sass
npm install --save-dev node-sass
</code></pre>


</div>
<div id="MySignature" role="contentinfo">
    <div style="text-align:center;color:#ccc;font-size:14px">-------------已经触及底线 <i class="fa fa-paw"></i> 感谢您的阅读-------------</div><br><br>
来源:https://www.cnblogs.com/cnsyear/p/13799953.html
頁: [1]
查看完整版本: npm报错:Node Sass could not find a binding for your current environment: Windows 64-bit with Node.js 10.x