当前位置:网站首页>【prettier】通过prettier自动格式化代码不生效
【prettier】通过prettier自动格式化代码不生效
2022-07-13 17:37:00 【菜卷_】
问题描述:
vscode通过prettier自动格式化代码的时候不生效,而且只有这一个项目不生效,其它项目都可以原因分析:
点击vscode右下角的Prettier,发现报错,翻译过来就是项目中配置的prettier版本太低。
[“ERROR” - 上午9:41:40] Your project is configured to use an outdated version of prettier that cannot be used by this extension. Upgrade to the latest version of prettier.

解决方案:
知道原因解决起来就比较简单了,直接运行如下命令
npm install prettier
如果还是报错,检查一下package-lock中的prettier版本是否和package里一致,如果不一致,直接删掉package-lock,然后运行
npm install prettier
最后记得重启vscodoe
边栏推荐
猜你喜欢

Call GPU completely through torch on pycharm (the most detailed)

解决ssm項目上傳圖片後無法及時回顯

<statement> or DELIMITER expected, got ‘id‘

ES6--string(字符串)

XML介绍

MVN clean or MVN clean package did not detect the test file

蓝桥杯单片机第13届省赛题

抓包工具之fiddler的安装使用

【黄啊码】今天居然有人问我:where 1=1 是什么意思?

ES6新增的变量修饰符let和const、新增的基本数据类型symbol
随机推荐
Kubernetes into the pit
数据库进阶
Picture definition problem
ES6的高级赋值方法——解构赋值
el-button 显示与禁用
Array changes, but the view cannot be updated (reason and thinking)
ES6内置对象的新方法新特性
Why blog?
命令行客户端的使用
SNMP起步啦
JS字符串内置功能
Summary of wechat red envelope project test
油猴脚本更改tw樣式
【黄啊码】老师,高考后我想选软件开发相关专业,你觉得选哪个方向好?高考志愿怎么填报?
蓝桥杯:单片机组第十三届省赛第二场
随机信号分析第2版 [赵淑清郑薇编著] (部分)课后作业答案(自己写的)
vue+axios+mysql实现分页查询,条件查询以及批量删除
c语言中的输入输出函数之scanf函数
Register the implementation.
【黄啊码】redis实现模糊查询并删除|redis根据前缀获取key