Cannot find module 'postcss-px2rem'
时间: 2023-09-13 09:06:49 浏览: 125
前端开源库-postcss-px2rem
根据引用\[1\]和引用\[3\]的信息,"Cannot find module 'postcss-px2rem'"错误可能是由于缺少postcss-px2rem模块导致的。你可以尝试重新安装postcss-px2rem模块,可以使用以下命令降低版本并重新安装:
```
yarn add postcss-pxtorem@5.1.1
```
这将安装5.1.1版本的postcss-pxtorem模块。请确保你的vue.config.js文件中的配置正确,如引用\[2\]所示。重新安装模块后,再次运行你的代码,应该就能解决这个错误了。
#### 引用[.reference_title]
- *1* *2* [vue-cli3.0 使用postcss-plugin-px2rem(推荐)和 postcss-pxtorem(postcss-px2rem)自动转换px为rem 的...](https://blog.csdn.net/qq_35697034/article/details/89098232)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item]
- *3* [Error:Loading PostCSS Plugin failed: Cannot find module ‘postcss-pxtorem](https://blog.csdn.net/qq_57305148/article/details/118614933)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文