最近用 macbook
的 vs code
格式化一直不顺利,找了很多方法,后面发现关掉拓展设置里面的寻找全局模块就行了
prettier.resolveGlobalModules (default: false)
When enabled, this extension will attempt to use global npm or yarn modules if local modules cannot be resolved.
NOTE: This setting can have a negative performance impact, particularly on Windows when you have attached network drives. Only enable this if you must use global modules. It is recommended that you always use local modules when possible.
去到 vs code
拓展设置里面找到 Resolve Global Modules
关掉即可
Prettier: Resolve Global Modules
When enabled, this extension will attempt to use global npm or yarn modules if local modules cannot be resolved.
This setting can have a negative performance impact, particularly on Windows when you have attached network drives. Only enable this if you must use global modules.