学成在线Windows 64-bit with Unsupported runtime (64)/Cannot find module 'node-sass'

前端报错

 error  in ./src/base/components/head.vue

Module build failed: Error: Node Sass does not yet support your current environment: Windows 64-bit with Unsupported runtime (64)
For more information on which environments are supported please see:
https://github.com/sass/node-sass/releases/tag/v4.7.2
    at module.exports (F:\xuechengzaixian\xcUI\xc-ui-pc-sysmanage\node_modules\node-sass\lib\binding.js:13:13)
    at Object. (F:\xuechengzaixian\xcUI\xc-ui-pc-sysmanage\node_modules\node-sass\lib\index.js:14:35)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:22:18)
    at Object. (F:\xuechengzaixian\xcUI\xc-ui-pc-sysmanage\node_modules\sass-loader\lib\loader.js:3:14)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
    at Module.require (internal/modules/cjs/loader.js:637:17)

 @ ./node_modules/vue-style-loader!./node_modules/css-loader?{"sourceMap":false}!./node_modules/vue-loader/lib/style-compiler?{"vue":true,"id":"data-v-1340bee1","scoped":true,"hasInlineConfig":false}!./node_modules/sass-loader/lib/loader.js?{"sourceMap":false}!./node_modules/vue-loader/lib/selector.js?type=styles&index=0&bustCache!./src/base/components/head.vue 4:14-395 13:3-17:5 14:22-403
 @ ./src/base/components/head.vue
 @ ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/selector.js?type=script&index=0&bustCache!./src/module/home/page/home.vue
 @ ./src/module/home/page/home.vue
 @ ./src/module/home/router/index.js
 @ ./src/base/router/index.js
 @ ./src/main.js
 @ multi (webpack)-dev-server/client?http://localhost:11000 webpack/hot/dev-server ./src/main.js

报错2

 error  in ./src/base/components/head.vue

Module build failed: Error: Cannot find module 'node-sass'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15)
    at Function.Module._load (internal/modules/cjs/loader.js:507:25)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:22:18)
    at Object. (F:\xuechengzaixian\xcUI\xc-ui-pc-sysmanage\node_modules\sass-loader\lib\loader.js:3:14)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:22:18)
    at loadLoader (F:\xuechengzaixian\xcUI\xc-ui-pc-sysmanage\node_modules\loader-runner\lib\loadLoader.js:13:17)
    at iteratePitchingLoaders (F:\xuechengzaixian\xcUI\xc-ui-pc-sysmanage\node_modules\loader-runner\lib\LoaderRunner.js:169:2)
    at iteratePitchingLoaders (F:\xuechengzaixian\xcUI\xc-ui-pc-sysmanage\node_modules\loader-runner\lib\LoaderRunner.js:165:10)
    at F:\xuechengzaixian\xcUI\xc-ui-pc-sysmanage\node_modules\loader-runner\lib\LoaderRunner.js:173:18

 @ ./node_modules/vue-style-loader!./node_modules/css-loader?{"sourceMap":false}!./node_modules/vue-loader/lib/style-compiler?{"vue":true,"id":"data-v-1340bee1","scoped":true,"hasInlineConfig":false}!./node_modules/sass-loader/lib/loader.js?{"sourceMap":false}!./node_modules/vue-loader/lib/selector.js?type=styles&index=0&bustCache!./src/base/components/head.vue 4:14-395 13:3-17:5 14:22-403
 @ ./src/base/components/head.vue
 @ ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/selector.js?type=script&index=0&bustCache!./src/module/home/page/home.vue
 @ ./src/module/home/page/home.vue
 @ ./src/module/home/router/index.js
 @ ./src/base/router/index.js
 @ ./src/main.js
 @ multi (webpack)-dev-server/client?http://localhost:11000 webpack/hot/dev-server ./src/main.js

产生原因

node-sass版本不一致,或没安装正确

解决

从第一个方法开始试验,如不行,依次向下试验,则会成功

方法一:

打开cmd窗口执行命令执行

npm update --save node-sass
方法二:

打开cmd窗口执行命令执行

npm install node-sass --save-dev
方法三:

找到当前执行的dev把安装路径更改为当前安装的路径

第一步:

在这里插入图片描述

第二步:

学成在线Windows 64-bit with Unsupported runtime (64)/Cannot find module 'node-sass'_第1张图片

第三步:

学成在线Windows 64-bit with Unsupported runtime (64)/Cannot find module 'node-sass'_第2张图片

总结

  • 问题有很多种类型根据每种解决方法依次试

你可能感兴趣的:(异常报错)