无法解析模块 "tailwindcss/nesting"
Could not resolve module "tailwindcss/nesting"
在遵循 official guide for TailwindCSS with PostCSS 时,我发现自己遇到了错误:
@parcel/transformer-postcss: Could not resolve module "tailwindcss/nesting" from "C:\Users\Daniel\source\repos\AFP_Reservas\.postcssrc"
我的 .postcssrc 文件如下所示:
{
"modules": false,
"plugins": {
"postcss-import": {},
"tailwindcss/nesting": {},
"tailwindcss": {}
"autoprefixer": {
"grid": true
}
}
}
tailwind.config.js 看起来像这样:
module.exports = {
future: {
// removeDeprecatedGapUtilities: true,
// purgeLayersByDefault: true,
},
purge: [
'./Maquetas/home.html'
],
theme: {
extend: {},
},
variants: {},
plugins: [],
}
并且我安装了以下依赖项:
"devDependencies": {
"@parcel/transformer-sass": "^2.0.0",
"autoprefixer": "^10.4.0",
"parcel": "^2.0.0",
"postcss": "^8.3.11",
"postcss-import": "^14.0.2",
"postcss-nested": "^5.0.6",
"tailwindcss": "^1.9.6"
}
我错过了什么吗?我尝试安装@tailwindcss/nesting,但嵌套模块应该是核心 tailwindcss 模块的一部分。
因为我使用的是Tailwind 1.9版本(因客户端需要支持Internet Explorer)我不能使用tailwindcss/nesting,根据1.9 documentation你必须使用postcss-nested
.
在遵循 official guide for TailwindCSS with PostCSS 时,我发现自己遇到了错误:
@parcel/transformer-postcss: Could not resolve module "tailwindcss/nesting" from "C:\Users\Daniel\source\repos\AFP_Reservas\.postcssrc"
我的 .postcssrc 文件如下所示:
{
"modules": false,
"plugins": {
"postcss-import": {},
"tailwindcss/nesting": {},
"tailwindcss": {}
"autoprefixer": {
"grid": true
}
}
}
tailwind.config.js 看起来像这样:
module.exports = {
future: {
// removeDeprecatedGapUtilities: true,
// purgeLayersByDefault: true,
},
purge: [
'./Maquetas/home.html'
],
theme: {
extend: {},
},
variants: {},
plugins: [],
}
并且我安装了以下依赖项:
"devDependencies": {
"@parcel/transformer-sass": "^2.0.0",
"autoprefixer": "^10.4.0",
"parcel": "^2.0.0",
"postcss": "^8.3.11",
"postcss-import": "^14.0.2",
"postcss-nested": "^5.0.6",
"tailwindcss": "^1.9.6"
}
我错过了什么吗?我尝试安装@tailwindcss/nesting,但嵌套模块应该是核心 tailwindcss 模块的一部分。
因为我使用的是Tailwind 1.9版本(因客户端需要支持Internet Explorer)我不能使用tailwindcss/nesting,根据1.9 documentation你必须使用postcss-nested
.