node 업그레이드 후 node-sass 오류 발생

15793 단어

node 업그레이드 후 node-sass 오류 발생

  • 오류 보고는 다음과 같다
  • 원인
  • 해결 방법

  • 오보 정보는 아래와 같다.

    ERROR  Failed to compile with 1 errors                                                                       1:56:26
    
     error  in ./src/components/Hello.vue
    
    Module build failed: Error: Missing binding /Users/fungleo/Sites/MyWork/vuedemo2/node_modules/node-sass/vendor/darwin-x64-57/binding.node
    Node Sass could not find a binding for your current environment: OS X 64-bit with Node.js 8.x
    
    Found bindings for the following environments:
      - OS X 64-bit with Node.js 6.x
    
    This usually happens because your environment has changed since running `npm install`.
    Run `npm rebuild node-sass --force` to build the binding for your current environment.
        at module.exports (/Users/fungleo/Sites/MyWork/vuedemo2/node_modules/node-sass/lib/binding.js:15:13)
        at Object.<anonymous> (/Users/fungleo/Sites/MyWork/vuedemo2/node_modules/node-sass/lib/index.js:14:35)
        at Module._compile (module.js:635:30)
        at Object.Module._extensions..js (module.js:646:10)
        at Module.load (module.js:554:32)
        at tryModuleLoad (module.js:497:12)
        at Function.Module._load (module.js:489:3)
        at Module.require (module.js:579:17)
        at require (internal/module.js:11:18)
        at Object.<anonymous> (/Users/fungleo/Sites/MyWork/vuedemo2/node_modules/sass-loader/lib/loader.js:3:14)
        at Module._compile (module.js:635:30)
        at Object.Module._extensions..js (module.js:646:10)
        at Module.load (module.js:554:32)
        at tryModuleLoad (module.js:497:12)
        at Function.Module._load (module.js:489:3)
        at Module.require (module.js:579:17)
    
     @ ./~/vue-style-loader!./~/css-loader?{"minimize":false,"sourceMap":false}!./~/vue-loader/lib/style-compiler?{"vue":true,"id":"data-v-2d1bdf0c","scoped":false,"hasInlineConfig":false}!./~/sass-loader/lib/loader.js?{"sourceMap":false}!./~/vue-loader/lib/selector.js?type=styles&index=0!./src/components/Hello.vue 4:14-394 13:3-17:5 14:22-402
     @ ./src/components/Hello.vue
     @ ./src/router/index.js
     @ ./src/main.js
     @ multi ./build/dev-client ./src/main.js
    

    원인


    node-sass가 node v8과 호환되지 않는 버전

    해결 방법

    npm i node-sass -D
    

    또는
    npm rebuild node-sass
    

    이 문장을 참고하여 원문 링크를 정리하다

    좋은 웹페이지 즐겨찾기