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.

Command 'Format Document With...' resulted in an error (command 'npm.packageManager' not found)

See original GitHub issue

Summary

It does works first them when i reinstall the extension. But when i reload the VS CODE it stops working again.

Github Repository to Reproduce Issue

Just use any Javascript File

Steps To Reproduce:

  1. CMD + SHIFT + P
  2. Format Document With
  3. Prettier Code Formatter

Expected result

It should format the code

Actual result

It’s giving error Command 'Format Document With...' resulted in an error (command 'npm.packageManager' not found)

Additional information

Feel free to attach a screenshot. Screenshot 2021-04-27 at 9 12 11 PM

VS Code Version: 1.55.2

Prettier Extension Version: 6.3.2

OS and version: OSX Catalina 10.15.6 (19G73

Prettier Log Output

["INFO" - 9:06:10 PM] Extension Name: esbenp.prettier-vscode.
["INFO" - 9:06:10 PM] Extension Version: 6.3.2.
["INFO" - 9:06:12 PM] Formatting /Volumes/D/www/php/wordpress/wp-content/plugins/analyzify/assets/analyzify-frontend.js
["INFO" - 9:06:12 PM] Using ignore file (if present) at /Volumes/D/www/php/wordpress/.prettierignore
["INFO" - 9:09:33 PM] Formatting /Volumes/D/www/php/wordpress/wp-content/plugins/analyzify/assets/analyzify-frontend.js
["INFO" - 9:09:33 PM] Using ignore file (if present) at /Volumes/D/www/php/wordpress/.prettierignore

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:1
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
khanakiacommented, Apr 28, 2021

@ntotten I think i found the issue 👍 when i have this config is set to true "prettier.resolveGlobalModules": true then it gives the above mentioned error.

So please enable that setting and then test it also i am attaching the vscode settings.json file settings.json

0reactions
asherotocommented, Feb 23, 2022

@ntotten I think i found the issue 👍 when i have this config is set to true "prettier.resolveGlobalModules": true then it gives the above mentioned error.

So please enable that setting and then test it also i am attaching the vscode settings.json file settings.json

This resolved it for me, thanks.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Prettier says it's formatting but it is not - Stack Overflow
If I run Format Document With > Prettier from the Command Palette, ... resulted in an error (command 'npm.packageManager' not found).
Read more >
Command 'Format Document With...' resulted in an error ...
Command 'Format Document With...' resulted in an error (command 'npm.packageManager' not found)
Read more >
ESLint - npm
You can install and configure ESLint using this command: ... both using Prettier to format your code and ESLint to catch possible errors....
Read more >
npm, pnpm, and Yarn | IntelliJ IDEA Documentation - JetBrains
In the embedded Terminal ( Alt+F12 ) , type one of the following commands: npm install. yarn install. pnpm install. As a result...
Read more >
npm packages in the Package Registry - GitLab Docs
When an npm package is not found in the Package Registry, the request is ... The GitLab npm repository supports the following commands...
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