【发布时间】:2021-06-09 09:32:09
【问题描述】:
我正在使用 vuejs3 和 tailwindcss 构建一个应用程序
我在开始项目之前测试了一些配置然后我得到了这个错误
npm run build 抛出:
ERROR Failed to compile with 1 error 2:48:15 PM
error in ./src/styles/index.css
Error: PostCSS plugin postcss-purgecss requires PostCSS 8.
Migration guide for end-users:
https://github.com/postcss/postcss/wiki/PostCSS-8-for-end-users
@ ./src/main.js 9:0-28
@ multi ./src/main.js
ERROR Build failed with errors.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! test-vue-env@0.1.0 build: `vue-cli-service build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the test-vue-env@0.1.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
这是我在package.json中的devDependencies:
{
"devDependencies": {
"@fullhuman/postcss-purgecss": "^4.0.0",
"@fullhuman/vue-cli-plugin-purgecss": "~4.0.2",
"@vue/cli-plugin-babel": "~4.5.0",
"@vue/cli-plugin-eslint": "~4.5.0",
"@vue/cli-plugin-router": "~4.5.0",
"@vue/cli-plugin-vuex": "~4.5.0",
"@vue/cli-service": "~4.5.0",
"@vue/compiler-sfc": "^3.0.0",
"@vue/eslint-config-prettier": "^6.0.0",
"autoprefixer": "^10.2.5",
"babel-eslint": "^10.1.0",
"eslint": "^6.7.2",
"eslint-plugin-prettier": "^3.1.3",
"eslint-plugin-vue": "^7.0.0-0",
"node-sass": "^5.0.0",
"postcss": "^8.2.8",
"prettier": "^1.19.1",
"sass-loader": "^10.1.1",
"tailwindcss": "^2.0.3"
}
}
感谢您的宝贵时间!
【问题讨论】:
-
OP 没有列出反应。 create-react-app 是什么让你使用 postcss-7-compat 运行 postcss 7 和 tailwindcss。
标签: node.js vue.js npm tailwind-css postcss