plugin-php icon indicating copy to clipboard operation
plugin-php copied to clipboard

Plugin cannot be loaded when used as a global package

Open trymeouteh opened this issue 1 year ago • 1 comments

When I install this plugin with the prettier package as a global npm package

npm install --global prettier @prettier/plugin-php

I am unable to use the PHP plugin to format PHP code. When I format a PHP file, I get the following error...

$ prettier ./index.php --write
[error] Cannot find package '@prettier/plugin-php' imported from /home/john/Documents/website/noop.js

Please allow developers to install the plugin globally and be able to use the plugin to format PHP files.

trymeouteh avatar Aug 02 '24 02:08 trymeouteh

I was able to reproduce this, and it seems to be a known issue in Prettier: https://github.com/prettier/prettier/issues/15141

czosel avatar Aug 02 '24 12:08 czosel