What to do when prettier not working vscode?

201    Asked by DavidEdmunds in Salesforce , Asked on May 2, 2023

I am not able to configure "Prettier" into my VS Code.

Followed the following steps:

Installed Prettier and selected Prettier as the 'Default Formatter' for both User and Workspace.

Installed node js.

Ran the command npm install

Ran the command npm i prettier -g

Extracted the prettier path npm root -g

Added the path 'AppDataRoamingnpmnode_modulesprettier' to the prettier path as is mentioned in the following solution in "https://stackoverflow.com/questions/58866847/in-vs-code-im-getting-this-error-failed-to-load-module-attempted-to-load-pr". Added the permission 'Format on Save' in the VS code. But now I am receiving this error

["ERROR" - 4:16:59 pm] Error loading node module 'AppDataRoamingnpmnode_modulesprettier' ["ERROR" - 4:16:59 pm] Cannot find module 'AppDataRoamingnpmnode_modulesprettier'.
Answered by Clare Matthews
In case of prettier not working vscode -

try this "npm install --save-dev --save-exact prettier"


Your Answer

Interviews

Parent Categories