question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

prettyHtml format error: Cannot find module 'prettier'

See original GitHub issue

如何复现:

步骤1: 更新插件版本到2.3.1

步骤2: 设置插件配置 “minapp-vscode.wxmlFormatter”: “prettyHtml”, // 指定格式化工具 “minapp-vscode.prettyHtml”: { // prettyHtml 默认配置 “useTabs”: false, “tabWidth”: 2, “printWidth”: 200, “singleQuote”: false, “usePrettier”: true, “wrapAttributes”: true, // 设置成 true 强制属性换行 “sortAttributes”: true }

步骤3: 打开任意 wxml 文件进行保存

期望的表现: 正常格式化 wxml 文件

实际的表现: VS Code 右下角报错 prettyHtml format error: Cannot find module ‘prettier’

插件运行环境

  • 插件版本: 2.3.1
  • VSCode版本:1.59.1
  • 操作系统(非必须):windows 10

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
iChenLeicommented, Aug 31, 2021

https://github.com/wx-minapp/minapp-vscode/compare/v2.2.2...v2.3.1

这是最新版本和两年前的2.2.2版本代码diff对比, 没看出来问题,老版本运行正常吗? 问题我可以复现,最近几天修一下

0reactions
MaoXuKuncommented, Aug 31, 2021

升级到 v2.3.3 此问题已修复,感谢大佬

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot find module 'prettier' - node.js - Stack Overflow
Prettier is a peer dependency of @vue/eslint-config-prettier so you need to add it to your own dependencies:
Read more >
Cannot find module 'prettier' · Issue #905 - GitHub
Run Format document . Expected result. It should format my file using Prettier. Actual result. Got the following error instead: 13/8 ...
Read more >
Cannot find module 'prettier' error | bobbyhadz
To solve the error "Cannot find module 'prettier'", make sure to install the prettier package by opening your terminal in your project's root...
Read more >
Cannot find module 'prettier' error [Solved] - Reactgo
The “Cannot find module 'prettier'” error occurs due to one of the following reasons: The module is not installed in the correct project…...
Read more >
pretty-html-table - PyPI
pretty_html_table exists to convert a pandas DataFrame into a pretty html table for ... The html formatting is set at the DataFrame row...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found