错误:Dart Sass版本1.23.0-module.beta.1与^ 1.3.0不兼容 [英] Error: Dart Sass version 1.23.0-module.beta.1 is incompatible with ^1.3.0
问题描述
它几周前在另一台计算机上工作了!:)
It worked few weeks ago on different computer! :)
尝试使用nodejs,npm和laravel-mix和webpack在Drupal上用Bootstrap-Sass启动新主题.以前从未使用过它,我只是按照yt教程进行操作.已安装Nodejs和npm,并添加了laravel-mix.
Trying to start new theme with Bootstrap-Sass on Drupal using nodejs, npm and laravel-mix and webpack. Never used it before, I just follow yt tutorial. Nodejs and npm have been installed and with that laravel-mix have been added.
在主题文件夹中,已创建以下文件:
Inside the theme folder following files have been created:
webpack.mix.js-与上次创建的内容相同,可将sass转换为css.
webpack.mix.js - created with same content as last time to convert sass to css.
package.json-自动创建,并根据git-hub上的laravel-mix指南手动添加"dev"命令,以实现从sass到css的快速,美观的转换.
package.json - created automatically and 'dev' command added manually as per laravel-mix guidance on git-hub to make quick, nice conversion from sass to css.
运行后:
npm run dev
出现以下所有错误.
有点意外,因为错误是关于1.3版的,甚至根本不存在!
Bit of a suprise as error is about version 1.3 that do not even exist!
不确定从这里要去哪里.
Not sure where to go from here.
> pbdtheme@1.0.0 dev /var/www/pbd/web/themes/custom/pbdtheme
> npm run development
> pbdtheme@1.0.0 development /var/www/pbd/web/themes/custom/pbdtheme
> cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js
98% after emitting SizeLimitsPlugin
ERROR Failed to compile with 2 errors 12:22:55 AM
error in ./scss/style.scss
Module build failed (from ./node_modules/css-loader/index.js):
ModuleBuildError: Module build failed (from ./node_modules/sass-loader/dist/cjs.js):
Error: Dart Sass version 1.23.0-module.beta.1 is incompatible with ^1.3.0.
at getRenderFuncFromSassImpl (/var/www/pbd/web/themes/custom/pbdtheme/node_modules/sass-loader/dist/index.js:159:13)
at Object.loader (/var/www/pbd/web/themes/custom/pbdtheme/node_modules/sass-loader/dist/index.js:79:18)
at runLoaders (/var/www/pbd/web/themes/custom/pbdtheme/node_modules/webpack/lib/NormalModule.js:313:20)
at /var/www/pbd/web/themes/custom/pbdtheme/node_modules/loader-runner/lib/LoaderRunner.js:367:11
at /var/www/pbd/web/themes/custom/pbdtheme/node_modules/loader-runner/lib/LoaderRunner.js:233:18
at runSyncOrAsync (/var/www/pbd/web/themes/custom/pbdtheme/node_modules/loader-runner/lib/LoaderRunner.js:143:3)
at iterateNormalLoaders (/var/www/pbd/web/themes/custom/pbdtheme/node_modules/loader-runner/lib/LoaderRunner.js:232:2)
at /var/www/pbd/web/themes/custom/pbdtheme/node_modules/loader-runner/lib/LoaderRunner.js:205:4
at process.nextTick (/var/www/pbd/web/themes/custom/pbdtheme/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:73:15)
at process._tickCallback (internal/process/next_tick.js:61:11)
error in ./scss/style.scss
Module build failed (from ./node_modules/sass-loader/dist/cjs.js):
Error: Dart Sass version 1.23.0-module.beta.1 is incompatible with ^1.3.0.
at getRenderFuncFromSassImpl (/var/www/pbd/web/themes/custom/pbdtheme/node_modules/sass-loader/dist/index.js:159:13)
at Object.loader (/var/www/pbd/web/themes/custom/pbdtheme/node_modules/sass-loader/dist/index.js:79:18)
@ ./scss/style.scss 2:14-189
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! pbdtheme@1.0.0 development: `cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the pbdtheme@1.0.0 development 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! /home/ski/.npm/_logs/2019-09-04T23_22_55_885Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! pbdtheme@1.0.0 dev: `npm run development`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the pbdtheme@1.0.0 dev 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! /home/ski/.npm/_logs/2019-09-04T23_22_55_959Z-debug.log
在执行上述命令后,style.css文件应填充代码,但其中没有内容.
After above command style.css file should be filled with code but no content is there.
推荐答案
遇到同样的问题.在您的package.json文件中,将"sass" devDependencies的版本更新为"^ 1.22.0"
Ran into the same issue. In you package.json file, update the version of the "sass" devDependencies to "^1.22.0"
"sass": "^1.22.0"
转储您的node_modules目录,然后再次安装npm.现在所有人都应该工作.
Dump your node_modules directory and npm install again. All should work now.
其他:可能很快就会解决的问题.似乎自动安装的版本在BETA中.
Additional: Likely an issue that will be resolved soon. Seems the version that is automatically installed is in BETA.
这篇关于错误:Dart Sass版本1.23.0-module.beta.1与^ 1.3.0不兼容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!