最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

vue項(xiàng)目安裝scss常見報(bào)錯(cuò)處理方式

 更新時(shí)間:2022年09月23日 08:40:48   作者:隔壁丿老蘇  
這篇文章主要介紹了vue項(xiàng)目安裝scss常見報(bào)錯(cuò)處理方式,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教

安裝sass依賴

npm install --save-dev sass-loader
//sass-loader依賴于node-sass
npm install --save-dev node-sass

第一種:Module build failed: TypeError: this.getResolve is not a function

如果運(yùn)行之后項(xiàng)目報(bào)錯(cuò)

Module build failed: TypeError: this.getResolve is not a function
    at Object.loader (C:\Users\DELL\Desktop\fantastic-macarons\node_modules\sass-loader\dist\index.js:52:26)
 
 @ ./node_modules/vue-style-loader!./node_modules/css-loader?{"sourceMap":true}!./node_modules/vue-loader/lib/style-compiler?{"vue":true,"id":"data-v-469af010","scoped":true,"hasInlineConfig":false}!./node_modules/sass-loader/dist/cjs.js?{"sourceMap":true}!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/components/HelloWorld.vue 4:14-375 13:3-17:5 14:22-383
 @ ./src/components/HelloWorld.vue
 @ ./src/router/index.js
 @ ./src/main.js
 @ multi (webpack)-dev-server/client?http://localhost:8080 webpack/hot/dev-server ./src/main.js

那是sass-loader 版本太高, 更換成 7.3.1

?npm uninstall sass-loader(卸載當(dāng)前版本)
?npm install sass-loader@7.3.1 --save-dev

在build文件夾下的webpack.base.conf.js的rules里面添加配置

{
?? ?test: /\.scss$/,
?? ?loaders: ['style', 'css', 'sass']
}

就可以在別的文件中引

引入scss文件,使用

@import '../assets/scss/triangle.scss'

不用使用

@import url('../assets/scss/triangle.scss');

會(huì)產(chǎn)生報(bào)錯(cuò)

第二種:Syntax Error: Error: PostCSS received undefined instead of CSS string

 ERROR  Failed to compile with 1 error7:07:54 ├F10: PM┤
 
 error  in ./src/components/TotalSales/index.vue?vue&type=style&index=0&id=86e7da4a&lang=scss&scoped=true&
 
Syntax Error: Error: PostCSS received undefined instead of CSS string
 
 @ ./node_modules/vue-style-loader??ref--8-oneOf-1-0!./node_modules/css-loader/dist/cjs.js??ref--8-oneOf-1-1!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src??ref--8-oneOf-1-2!./node_modules/sass-loader/dist/cjs.js??ref--8-oneOf-1-3!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/TotalSales/index.vue?vue&type=style&index=0&id=86e7da4a&lang=scss&scoped=true& 4:14-478 14:3-18:5 15:22-486

問(wèn)題原因

node-sass 和 sass-loader 版本與當(dāng)前的不兼容,安裝對(duì)應(yīng)版本的包即可。

解決方案

卸載node-sass 和 sass-loader

npm uninstall node-sass sass-loader

安裝對(duì)應(yīng)版本的包

npm install node-sass@4.14.1 sass-loader@8.0.0 --dev

第三種:Cannot find module ‘node-sass’

按照往常的思路,應(yīng)該是 npm install 的時(shí)候,出錯(cuò)了。于是我選擇重新 npm install node-sass -D,但是安裝的時(shí)候,報(bào)錯(cuò)了

gyp info it worked if it ends with ok
gyp verb cli [
gyp verb cli   'C:\\Program Files\\nodejs\\node.exe',
gyp verb cli   'D:\\vue\\readbook-admin\\node_modules\\node-gyp\\bin\\node-gyp.js',
gyp verb cli   'rebuild',
gyp verb cli   '--verbose',
gyp verb cli   '--libsass_ext=',
gyp verb cli   '--libsass_cflags=',
gyp verb cli   '--libsass_ldflags=',
gyp verb cli   '--libsass_library='
gyp verb cli ]
gyp info using node-gyp@3.8.0
gyp info using node@12.15.0 | win32 | x64
gyp verb command rebuild []
gyp verb command clean []
gyp verb clean removing "build" directory
gyp verb command configure []
gyp verb check python checking for Python executable "python2" in the PATH
gyp verb `which` failed Error: not found: python2
gyp verb `which` failed     at getNotFoundError (D:\vue\readbook-admin\node_modules\which\which.js:13:12)
gyp verb `which` failed     at F (D:\vue\readbook-admin\node_modules\which\which.js:68:19)
gyp verb `which` failed     at E (D:\vue\readbook-admin\node_modules\which\which.js:80:29)
gyp verb `which` failed     at D:\vue\readbook-admin\node_modules\which\which.js:89:16
gyp verb `which` failed     at D:\vue\readbook-admin\node_modules\isexe\index.js:42:5
gyp verb `which` failed     at D:\vue\readbook-admin\node_modules\isexe\windows.js:36:5
gyp verb `which` failed     at FSReqCallback.oncomplete (fs.js:158:21)
gyp verb `which` failed  python2 Error: not found: python2
gyp verb `which` failed     at getNotFoundError (D:\vue\readbook-admin\node_modules\which\which.js:13:12)
gyp verb `which` failed     at F (D:\vue\readbook-admin\node_modules\which\which.js:68:19)
gyp verb `which` failed     at E (D:\vue\readbook-admin\node_modules\which\which.js:80:29)
gyp verb `which` failed     at D:\vue\readbook-admin\node_modules\which\which.js:89:16
gyp verb `which` failed     at D:\vue\readbook-admin\node_modules\isexe\index.js:42:5
gyp verb `which` failed     at D:\vue\readbook-admin\node_modules\isexe\windows.js:36:5
gyp verb `which` failed     at FSReqCallback.oncomplete (fs.js:158:21) {
gyp verb `which` failed   stack: 'Error: not found: python2\n' +
gyp verb `which` failed     '    at getNotFoundError (D:\\vue\\readbook-admin\\node_modules\\which\\which.js:13:12)\n' +
gyp verb `which` failed     '    at F (D:\\vue\\readbook-admin\\node_modules\\which\\which.js:68:19)\n' +
gyp verb `which` failed     '    at E (D:\\vue\\readbook-admin\\node_modules\\which\\which.js:80:29)\n' +
gyp verb `which` failed     '    at D:\\vue\\readbook-admin\\node_modules\\which\\which.js:89:16\n' +
gyp verb `which` failed     '    at D:\\vue\\readbook-admin\\node_modules\\isexe\\index.js:42:5\n' +
gyp verb `which` failed     '    at D:\\vue\\readbook-admin\\node_modules\\isexe\\windows.js:36:5\n' +
gyp verb `which` failed     '    at FSReqCallback.oncomplete (fs.js:158:21)',
gyp verb `which` failed   code: 'ENOENT'
gyp verb `which` failed }
gyp verb check python checking for Python executable "python" in the PATH
gyp verb `which` succeeded python C:\Users\DELL\AppData\Local\Programs\Python\Python37-32\python.EXE
gyp ERR! configure error
gyp ERR! stack Error: Command failed: C:\Users\DELL\AppData\Local\Programs\Python\Python37-32\python.EXE -c import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack   File "<string>", line 1
gyp ERR! stack     import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack                                ^
gyp ERR! stack SyntaxError: invalid syntax
gyp ERR! stack
gyp ERR! stack     at ChildProcess.exithandler (child_process.js:295:12)
gyp ERR! stack     at ChildProcess.emit (events.js:223:5)
gyp ERR! stack     at maybeClose (internal/child_process.js:1021:16)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
gyp ERR! System Windows_NT 10.0.18363
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "D:\\vue\\readbook-admin\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd D:\vue\readbook-admin\node_modules\node-sass
gyp ERR! node -v v12.15.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
Build failed with error code: 1
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.7 (node_modules\watchpack\node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
 
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass@4.14.1 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass@4.14.1 postinstall 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!     C:\Users\DELL\AppData\Roaming\npm-cache\_logs\2020-05-12T01_07_50_553Z-debug.log

安裝了 最新版本的 npm install node-sass@latest -D。

以上為個(gè)人經(jīng)驗(yàn),希望能給大家一個(gè)參考,也希望大家多多支持腳本之家。

相關(guān)文章

  • vue3中markRaw示例詳解

    vue3中markRaw示例詳解

    markRaw是將一個(gè)對(duì)象標(biāo)記為普通對(duì)象,而toRaw是將reactive對(duì)象變?yōu)槠胀▽?duì)象,在 Vue 3 中,markRaw 是一個(gè)用于告訴 Vue 的響應(yīng)性系統(tǒng)不要對(duì)某個(gè)對(duì)象進(jìn)行轉(zhuǎn)換或追蹤其響應(yīng)性的函數(shù),下面給大家介紹vue3中markRaw詳解,感興趣的朋友一起看看吧
    2024-04-04
  • 在Vue項(xiàng)目中使用Typescript的實(shí)現(xiàn)

    在Vue項(xiàng)目中使用Typescript的實(shí)現(xiàn)

    這篇文章主要介紹了在Vue項(xiàng)目中使用Typescript的實(shí)現(xiàn),文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧
    2019-12-12
  • vue的生命周期鉤子與父子組件的生命周期詳解

    vue的生命周期鉤子與父子組件的生命周期詳解

    Vue的生命周期就是vue實(shí)例從創(chuàng)建到銷毀的全過(guò)程,也就是new Vue() 開始就是vue生命周期的開始。Vue 實(shí)例有?個(gè)完整的?命周期,也就是從開始創(chuàng)建、初始化數(shù)據(jù)、編譯模版、掛載Dom -> 渲染、更新 -> 渲染、卸載 等?系列過(guò)程,稱這是Vue的?命周期
    2022-08-08
  • VUE實(shí)現(xiàn)分布式醫(yī)療掛號(hào)系統(tǒng)預(yù)約掛號(hào)首頁(yè)步驟詳情

    VUE實(shí)現(xiàn)分布式醫(yī)療掛號(hào)系統(tǒng)預(yù)約掛號(hào)首頁(yè)步驟詳情

    這篇文章主要為大家介紹了VUE實(shí)現(xiàn)分布式醫(yī)療掛號(hào)系統(tǒng)預(yù)約掛號(hào)首頁(yè)步驟詳情,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪
    2022-04-04
  • 基于Vue3實(shí)現(xiàn)圖片拖拽上傳功能

    基于Vue3實(shí)現(xiàn)圖片拖拽上傳功能

    前端開發(fā)中,用戶體驗(yàn)是至關(guān)重要的,圖像上傳是許多 web 應(yīng)用中經(jīng)常需要的功能之一,為了提升用戶的交互體驗(yàn),拖拽上傳功能可以減少用戶的操作步驟,本文將介紹如何使用 Vue 3實(shí)現(xiàn)一個(gè)簡(jiǎn)單的圖片拖拽上傳功能,需要的朋友可以參考下
    2024-08-08
  • Vue+Element?UI實(shí)現(xiàn)復(fù)制當(dāng)前行數(shù)據(jù)的功能

    Vue+Element?UI實(shí)現(xiàn)復(fù)制當(dāng)前行數(shù)據(jù)的功能

    這篇文章主要介紹了如何使用Vue?+?Element?UI?實(shí)現(xiàn)在列表的操作欄新增一個(gè)復(fù)制按鈕,復(fù)制當(dāng)前行的數(shù)據(jù)可以打開新增彈窗后亦可以跳轉(zhuǎn)到新增頁(yè)面,感興趣的小伙伴可以參考下
    2023-11-11
  • vue中checkbox如何修改為圓形樣式

    vue中checkbox如何修改為圓形樣式

    這篇文章主要介紹了vue中checkbox如何修改為圓形樣式,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教
    2022-12-12
  • vue配置vue.config.js超詳細(xì)教程

    vue配置vue.config.js超詳細(xì)教程

    Vue的配置項(xiàng)'vue.config.js'是用來(lái)配置Vue項(xiàng)目的構(gòu)建配置的,它是一個(gè)可選的配置文件,放置在項(xiàng)目的根目錄下,這篇文章主要給大家介紹了關(guān)于vue配置vue.config.js的相關(guān)資料,需要的朋友可以參考下
    2024-01-01
  • sortable+element 實(shí)現(xiàn)表格行拖拽的方法示例

    sortable+element 實(shí)現(xiàn)表格行拖拽的方法示例

    這篇文章主要介紹了sortable+element 實(shí)現(xiàn)表格行拖拽的方法示例,小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過(guò)來(lái)看看吧
    2019-06-06
  • vue+element加入簽名效果(移動(dòng)端可用)

    vue+element加入簽名效果(移動(dòng)端可用)

    這篇文章主要介紹了vue+element加入簽名效果(移動(dòng)端),本文通過(guò)實(shí)例代碼給大家介紹的非常詳細(xì),具有一定的參考借鑒價(jià)值,需要的朋友可以參考下
    2019-06-06

最新評(píng)論

通许县| 长子县| 冷水江市| 三门县| 布尔津县| 逊克县| 永修县| 治县。| 临沭县| 历史| 从化市| 安西县| 海宁市| 云阳县| 高雄县| 红河县| 临潭县| 读书| 海宁市| 垦利县| 页游| 札达县| 黄陵县| 运城市| 睢宁县| 锦屏县| 镇原县| 奉节县| 稷山县| 临夏市| 仁寿县| 潼关县| 大港区| 桑植县| SHOW| 汝阳县| 建水县| 丹寨县| 宣威市| 潼南县| 哈尔滨市|