Vue 前端笔记 | error Run `npm rebuild node-sass` to download the binding for your current environment

运行项目报错,如下,好像是nodejs 版本兼容问题。日后研究。

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.

Microsoft Windows [版本 6.1.7601]
版权所有 (c) 2009 Microsoft Corporation。保留所有权利。

D:\Desktop\家庭云\vue-element-quick-start>npm run build

> [email protected] build D:\Desktop\家庭云\vue-element-quick-start
> vue-cli-service build


\  Building for production...Starting type checking and linting service...
Using 1 worker with 2048MB memory limit
\  Building for production...

 ERROR  Failed to compile with 3 errors                                                                         23:16:49


 error  in ./src/components/common/style.scss

Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js):
ModuleBuildError: Module build failed (from ./node_modules/sass-loader/lib/loader.js):
Error: Missing binding D:\Desktop\家庭云\vue-element-quick-start\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 10.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:\Desktop\家庭云\vue-element-quick-start\node_modules\node-sass\lib\binding.js:15:13)
    at Object. (D:\Desktop\家庭云\vue-element-quick-start\node_modules\node-sass\lib\index.js:14:35)
    at Module._compile (internal/modules/cjs/loader.js:688:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)
    at Module.load (internal/modules/cjs/loader.js:598:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
    at Function.Module._load (internal/modules/cjs/loader.js:529:3)
    at Module.require (internal/modules/cjs/loader.js:636:17)
    at require (internal/modules/cjs/helpers.js:20:18)
    at Object.sassLoader (D:\Desktop\家庭云\vue-element-quick-start\node_modules\sass-loader\lib\loader.js:46:72)
    at runLoaders (D:\Desktop\家庭云\vue-element-quick-start\node_modules\webpack\lib\NormalModule.js:301:20)
    at D:\Desktop\家庭云\vue-element-quick-start\node_modules\loader-runner\lib\LoaderRunner.js:367:11
    at D:\Desktop\家庭云\vue-element-quick-start\node_modules\loader-runner\lib\LoaderRunner.js:233:18
    at runSyncOrAsync (D:\Desktop\家庭云\vue-element-quick-start\node_modules\loader-runner\lib\LoaderRunner.js:143:3)
    at iterateNormalLoaders (D:\Desktop\家庭云\vue-element-quick-start\node_modules\loader-runner\lib\LoaderRunner.js:23
2:2)
    at Array. (D:\Desktop\家庭云\vue-element-quick-start\node_modules\loader-runner\lib\LoaderRunner.js:205:4
)
    at Storage.finished (D:\Desktop\家庭云\vue-element-quick-start\node_modules\enhanced-resolve\lib\CachedInputFileSyst
em.js:43:16)
    at provider (D:\Desktop\家庭云\vue-element-quick-start\node_modules\enhanced-resolve\lib\CachedInputFileSystem.js:79
:9)
    at D:\Desktop\家庭云\vue-element-quick-start\node_modules\graceful-fs\graceful-fs.js:90:16
    at FSReqWrap.readFileAfterClose [as oncomplete] (internal/fs/read_file_context.js:53:3)

 @ ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-load
er/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/App.vue
?vue&type=script&lang=js& 16:0-40
 @ ./src/App.vue?vue&type=script&lang=js&
 @ ./src/App.vue
 @ ./src/main.ts
 @ multi ./src/main.ts

 error  in ./src/pages/home/home.vue?vue&type=style&index=0&id=30e20b87&lang=scss&scoped=true&

Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js):
ModuleBuildError: Module build failed (from ./node_modules/sass-loader/lib/loader.js):
Error: Missing binding D:\Desktop\家庭云\vue-element-quick-start\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 10.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:\Desktop\家庭云\vue-element-quick-start\node_modules\node-sass\lib\binding.js:15:13)
    at Object. (D:\Desktop\家庭云\vue-element-quick-start\node_modules\node-sass\lib\index.js:14:35)
    at Module._compile (internal/modules/cjs/loader.js:688:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)
    at Module.load (internal/modules/cjs/loader.js:598:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
    at Function.Module._load (internal/modules/cjs/loader.js:529:3)
    at Module.require (internal/modules/cjs/loader.js:636:17)
    at require (internal/modules/cjs/helpers.js:20:18)
    at Object.sassLoader (D:\Desktop\家庭云\vue-element-quick-start\node_modules\sass-loader\lib\loader.js:46:72)
    at runLoaders (D:\Desktop\家庭云\vue-element-quick-start\node_modules\webpack\lib\NormalModule.js:301:20)
    at D:\Desktop\家庭云\vue-element-quick-start\node_modules\loader-runner\lib\LoaderRunner.js:367:11
    at D:\Desktop\家庭云\vue-element-quick-start\node_modules\loader-runner\lib\LoaderRunner.js:233:18
    at runSyncOrAsync (D:\Desktop\家庭云\vue-element-quick-start\node_modules\loader-runner\lib\LoaderRunner.js:143:3)
    at iterateNormalLoaders (D:\Desktop\家庭云\vue-element-quick-start\node_modules\loader-runner\lib\LoaderRunner.js:23
2:2)
    at D:\Desktop\家庭云\vue-element-quick-start\node_modules\loader-runner\lib\LoaderRunner.js:186:6
    at context.callback (D:\Desktop\家庭云\vue-element-quick-start\node_modules\loader-runner\lib\LoaderRunner.js:111:13
)
    at async.each.err (D:\Desktop\家庭云\vue-element-quick-start\node_modules\cache-loader\dist\index.js:171:7)
    at D:\Desktop\家庭云\vue-element-quick-start\node_modules\neo-async\async.js:2825:7
    at done (D:\Desktop\家庭云\vue-element-quick-start\node_modules\neo-async\async.js:2861:11)
    at D:\Desktop\家庭云\vue-element-quick-start\node_modules\neo-async\async.js:2813:7
    at FS.stat (D:\Desktop\家庭云\vue-element-quick-start\node_modules\cache-loader\dist\index.js:160:9)
    at process.nextTick (D:\Desktop\家庭云\vue-element-quick-start\node_modules\enhanced-resolve\lib\CachedInputFileSyst
em.js:73:15)
    at process._tickCallback (internal/process/next_tick.js:61:11)

 @ ./src/pages/home/home.vue?vue&type=style&index=0&id=30e20b87&lang=scss&scoped=true& 1:0-549 1:565-568 1:570-1116 1:57
0-1116
 @ ./src/pages/home/home.vue
 @ ./src/router.ts
 @ ./src/main.ts
 @ multi ./src/main.ts

 error  in ./src/pages/page1/Page1.vue?vue&type=style&index=0&id=c4322a68&lang=scss&scoped=true&

Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js):
ModuleBuildError: Module build failed (from ./node_modules/sass-loader/lib/loader.js):
Error: Missing binding D:\Desktop\家庭云\vue-element-quick-start\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 10.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:\Desktop\家庭云\vue-element-quick-start\node_modules\node-sass\lib\binding.js:15:13)
    at Object. (D:\Desktop\家庭云\vue-element-quick-start\node_modules\node-sass\lib\index.js:14:35)
    at Module._compile (internal/modules/cjs/loader.js:688:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)
    at Module.load (internal/modules/cjs/loader.js:598:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
    at Function.Module._load (internal/modules/cjs/loader.js:529:3)
    at Module.require (internal/modules/cjs/loader.js:636:17)
    at require (internal/modules/cjs/helpers.js:20:18)
    at Object.sassLoader (D:\Desktop\家庭云\vue-element-quick-start\node_modules\sass-loader\lib\loader.js:46:72)
    at runLoaders (D:\Desktop\家庭云\vue-element-quick-start\node_modules\webpack\lib\NormalModule.js:301:20)
    at D:\Desktop\家庭云\vue-element-quick-start\node_modules\loader-runner\lib\LoaderRunner.js:367:11
    at D:\Desktop\家庭云\vue-element-quick-start\node_modules\loader-runner\lib\LoaderRunner.js:233:18
    at runSyncOrAsync (D:\Desktop\家庭云\vue-element-quick-start\node_modules\loader-runner\lib\LoaderRunner.js:143:3)
    at iterateNormalLoaders (D:\Desktop\家庭云\vue-element-quick-start\node_modules\loader-runner\lib\LoaderRunner.js:23
2:2)
    at D:\Desktop\家庭云\vue-element-quick-start\node_modules\loader-runner\lib\LoaderRunner.js:186:6
    at context.callback (D:\Desktop\家庭云\vue-element-quick-start\node_modules\loader-runner\lib\LoaderRunner.js:111:13
)
    at async.each.err (D:\Desktop\家庭云\vue-element-quick-start\node_modules\cache-loader\dist\index.js:171:7)
    at D:\Desktop\家庭云\vue-element-quick-start\node_modules\neo-async\async.js:2825:7
    at done (D:\Desktop\家庭云\vue-element-quick-start\node_modules\neo-async\async.js:2861:11)
    at D:\Desktop\家庭云\vue-element-quick-start\node_modules\neo-async\async.js:2813:7
    at FS.stat (D:\Desktop\家庭云\vue-element-quick-start\node_modules\cache-loader\dist\index.js:160:9)
    at process.nextTick (D:\Desktop\家庭云\vue-element-quick-start\node_modules\enhanced-resolve\lib\CachedInputFileSyst
em.js:73:15)
    at process._tickCallback (internal/process/next_tick.js:61:11)

 @ ./src/pages/page1/Page1.vue?vue&type=style&index=0&id=c4322a68&lang=scss&scoped=true& 1:0-550 1:566-569 1:571-1118 1:
571-1118
 @ ./src/pages/page1/Page1.vue
 @ ./src/router.ts
 @ ./src/main.ts
 @ multi ./src/main.ts

 ERROR  Build failed with errors.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build: `vue-cli-service build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     E:\Java\node-v10.13.0-win-x64\node_cache\_logs\2019-07-16T15_16_49_774Z-debug.log

D:\Desktop\家庭云\vue-element-quick-start>npm run build

解决方案:

当前项目下,执行 npm i node-sass -D 即可,会有点慢

 

引用:https://blog.csdn.net/FungLeo/article/details/78519747

你可能感兴趣的:(vue)