Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Actions Fails to install/use modules - Cannot find module '@prettier/plugin-php' #110

Open
BRAiNCHiLD95 opened this issue Feb 4, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@BRAiNCHiLD95
Copy link

BRAiNCHiLD95 commented Feb 4, 2023

What exactly happened?

Workflow fails with error -> Cannot find module '@prettier/plugin-php'

What should've happened?
The actions should've correctly formatted all files in the repo.

How did it look?

image

Run creyD/prettier_action@v4.2
  with:
    prettier_plugins: @prettier/plugin-php
    prettier_options: --write **/*.{js,css,php}
    only_changed: false
    commit_message: Prettified Code!
    same_commit: false
    file_pattern: *
    dry: false
    prettier_version: false
    working_directory: false
    github_token: ***
Run PATH=$(cd $GITHUB_ACTION_PATH; npm bin):$PATH /home/runner/work/_actions/creyD/prettier_action/v4.[2](https://github.com/vidtutech/vidtu-client/actions/runs/4091323125/jobs/7055324811#step:3:2)/entrypoint.sh
  PATH=$(cd $GITHUB_ACTION_PATH; npm bin):$PATH /home/runner/work/_actions/creyD/prettier_action/v[4](https://github.com/vidtutech/vidtu-client/actions/runs/4091323125/jobs/7055324811#step:3:4).2/entrypoint.sh
  shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
  env:
    INPUT_COMMIT_MESSAGE: Prettified Code!
    INPUT_COMMIT_DESCRIPTION: 
    INPUT_SAME_COMMIT: false
    INPUT_COMMIT_OPTIONS: 
    INPUT_FILE_PATTERN: *
    INPUT_PRETTIER_OPTIONS: --write **/*.{js,css,php}
    INPUT_DRY: false
    INPUT_PRETTIER_VERSION: false
    INPUT_ONLY_CHANGED: false
    INPUT_PRETTIER_PLUGINS: @prettier/plugin-php
    INPUT_WORKING_DIRECTORY: false
    INPUT_GITHUB_TOKEN: ***
  
Installing prettier...
Checking plugin: @prettier/plugin-php
Prettifying files...
Files:
Error:  Cannot find module '@prettier/plugin-php'
Error:  Require stack:
Error:  - /home/runner/work/_actions/creyD/prettier_action/v4.2/node_modules/prettier/index.js
Error:  - /home/runner/work/_actions/creyD/prettier_action/v4.2/node_modules/prettier/cli.js
Error:  - /home/runner/work/_actions/creyD/prettier_action/v4.2/node_modules/prettier/bin-prettier.js
Problem running prettier with --write **/*.{js,css,php}
Error: Process completed with exit code 1.

And this is the .prettierrc file in my repo -

{
	"semi": true,
	"useTabs": true,
	"tabWidth": 4,
	"printWidth": 100,
	"singleQuote": true,
	"quoteProps": "consistent",
	"trailingComma": "es5",
	"jsxSingleQuote": true,
	"bracketSpacing": true,
	"bracketSameLine": true,
	"arrowParens": "always",
	"singleAttributePerLine": true,
	"plugins": ["@prettier/plugin-php"],
	"phpVersion": "8.1",
	"braceStyle": "1tbs",
}

Other notes -
The plugins array in the .prettierrc is the latest change that I can think of. But I need that to get VSCode to use prettier locally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant