Vue.config.js
当我安装 sass 和 sass-loader 时,如何配置以使用 sass 现在我使用 sass 提示错误 无法从 'D:\demo ite' 找到模块 'sass'
你只需要使用以下命令安装 sass
npm install -D sass
此外,您可以在此处查看官方文档 https://vitejs.dev/guide/features.html#css-modules
尝试
yarn add -D sass
这几乎就是最后一个屏幕中给出的错误。
由于人们显然更喜欢使用 NPM,但现在有很多包管理器,所以这里我们确实有一个通用的解决方案
通过使用ni,你可以拥有
ni -D sass
将其安装到您的项目中,无论它使用 NPM、yarn、PNPM 或 Bun。
在其他答案中,他们使用
yarn
或 npm
但如果您使用 pnpm
:
pnpm i -D sass
i
是 install
: 的别名
-d
旗帜: