Couldn't resolve parser "php" in local installation
See original GitHub issueContext (Environment)
We’re trying to use blade-formatter in a Laravel 8 project on the latest MacOS but it can’t resolve the PHP parser. It does work when installing globally but we’d rather have it locally if possible.
Thanks for any help in advance!
Current Behavior
Every call results in the following error for every blade template checked
{
path: 'resources/views/xxx/show.blade.php',
message: `Couldn't resolve parser "php"`,
error: ConfigError$1: Couldn't resolve parser "php"
at resolveParser$1 (/xxx/node_modules/blade-formatter/node_modules/prettier/index.js:12487:13)
at normalize$1 (/xxx/node_modules/blade-formatter/node_modules/prettier/index.js:12582:18)
at formatWithCursor$1 (xxx/node_modules/blade-formatter/node_modules/prettier/index.js:14265:46)
at /xxx/node_modules/blade-formatter/node_modules/prettier/index.js:59304:12
at Object.format (/xxx/node_modules/blade-formatter/node_modules/prettier/index.js:59324:12)
at formatStringAsPhp (/xxx/node_modules/blade-formatter/src/util.js:42:19)
at /xxx/node_modules/blade-formatter/src/util.js:133:16
at String.replace (<anonymous>)
at Function.replace (/xxx/node_modules/lodash/lodash.js:14608:48)
at /xxx/node_modules/blade-formatter/src/util.js:132:9
}
Expected Behavior
No error message 😃
Steps to Reproduce
npm install --save-dev blade-formatter
node_modules/.bin/blade-formatter resources/**/*.blade.php
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Couldn't resolve parser "php" · Issue #3081 - GitHub
I installed it globally using composer, if that matters, and ran doom env again, to make sure it had the latest PATH.
Read more >Why does running prettier check return error "Couldn't resolve ...
I'm currently using prettier 2.3 which does support this parser, so I'm a bit confused as to what I could be doing incorrectly....
Read more >Document how to resolve nikic/php-parser v3 vs v4 composer ...
I'm trying to use this module on a site that is currently running php 5.6 and drupal 8.5.14 BUT I am running the...
Read more >Installation/Upgrading Issues - Snipe-IT Documentation
This always means that PHP is either not installed, or is not enabled in your Apache/Nginx/IIS/etc web server. PHP has two different parts...
Read more >PHP Developers Guide | Parse
Installation. There are various ways to install and use this sdk. We'll elaborate on a couple here. Note that the Parse PHP SDK...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I used the docker and don’t have the issue anymore.
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days