Open juanmaguitar opened 2 months ago
I answered in slack, but to add it here for others:
If you run
composer update
, then you should be able to runyarn setup:tools
again. Thereβs a dependency thatβs updated frequently that can get out of date.
This is a common error, we should add something to explain this to the readme.
For reference, when doing composer update
I got this error
Deprecation Notice: Using ${var} in strings is deprecated, use {$var} instead in phar:///usr/local/bin/composer/vendor/symfony/console/Command/DumpCompletionCommand.php:48
Deprecation Notice: Using ${var} in strings is deprecated, use {$var} instead in phar:///usr/local/bin/composer/vendor/symfony/console/Command/DumpCompletionCommand.php:56
Deprecation Notice: Using ${var} in strings is deprecated, use {$var} instead in phar:///usr/local/bin/composer/src/Composer/Autoload/AutoloadGenerator.php:875
Deprecation Notice: Using ${var} in strings is deprecated, use {$var} instead in phar:///usr/local/bin/composer/src/Composer/Autoload/AutoloadGenerator.php:880
Loading composer repositories with package information
GitHub API limit (0 calls/hr) is exhausted, could not fetch https://api.github.com/repos/WordPress/wporg-mu-plugins/contents/composer.json?ref=ed9879d762f9c46edd98e01ab8b492dbaea95af0. Create a GitHub OAuth token to go over the API rate limit. You can also wait until ? for the rate limit to reset.
When working with _public_ GitHub repositories only, head to https://github.com/settings/tokens/new?scopes=&description=Composer+on+Juans-MacBook-Pro-2.local+2024-05-07+1538 to retrieve a token.
This token will have read-only permission for public information only.
When you need to access _private_ GitHub repositories as well, go to https://github.com/settings/tokens/new?scopes=repo&description=Composer+on+Juans-MacBook-Pro-2.local+2024-05-07+1538
Note that such tokens have broad read/write permissions on your behalf, even if not needed by Composer.
Tokens will be stored in plain text in "/Users/juanmanuelgarrido/.composer/auth.json" for future use by Composer.
For additional information, check https://getcomposer.org/doc/articles/authentication-for-private-packages.md#github-oauth
Token (hidden):
This issue with the Composer command prompting for a GitHub token is due to hitting the API rate limit. To solve it I followed these steps:
Generate a GitHub Personal Access Token:
Provide the GitHub Token to Composer:
~/.composer/auth.json
for future use by Composer.Retry the Composer Command:
composer update
command to continue updating your dependencies:
composer update
By following these steps, I properly authenticated with GitHub using the personal access token and proceed with the Composer command without hitting the API rate limit.
After running composer update
succesfully I ran yarn setup:tools
again and got another set of errors (this time I think they have to be with a specific PHP version required)
yarn setup:tools
yarn run v1.22.19 $ yarn && composer install && TEXTDOMAIN=wporg composer exec update-configs && composer --working-dir=./source/wp-content/plugins/phpdoc-parser install [1/4] π Resolving packages... [2/4] π Fetching packages... [3/4] π Linking dependencies... warning " > @wordpress/scripts@27.1.0" has unmet peer dependency "@playwright/test@^1.39.0". warning " > @wordpress/scripts@27.1.0" has unmet peer dependency "react@^18.0.0". warning " > @wordpress/scripts@27.1.0" has unmet peer dependency "react-dom@^18.0.0". warning "@wordpress/scripts > @wordpress/e2e-test-utils-playwright@0.18.0" has unmet peer dependency "@playwright/test@>=1". warning "@wordpress/scripts > cssnano@6.0.3" has incorrect peer dependency "postcss@^8.4.31". warning "@wordpress/scripts > cssnano > cssnano-preset-default@6.0.3" has incorrect peer dependency "postcss@^8.4.31". warning "@wordpress/scripts > @wordpress/eslint-plugin > @typescript-eslint/eslint-plugin > ts-api-utils@1.0.3" has unmet peer dependency "typescript@>=4.2.0". warning "@wordpress/scripts > cssnano > cssnano-preset-default > cssnano-utils@4.0.1" has incorrect peer dependency "postcss@^8.4.31". warning "@wordpress/scripts > cssnano > cssnano-preset-default > postcss-colormin@6.0.2" has incorrect peer dependency "postcss@^8.4.31". warning "@wordpress/scripts > cssnano > cssnano-preset-default > postcss-convert-values@6.0.2" has incorrect peer dependency "postcss@^8.4.31". warning "@wordpress/scripts > cssnano > cssnano-preset-default > postcss-discard-comments@6.0.1" has incorrect peer dependency "postcss@^8.4.31". warning "@wordpress/scripts > cssnano > cssnano-preset-default > postcss-discard-duplicates@6.0.1" has incorrect peer dependency "postcss@^8.4.31". warning "@wordpress/scripts > cssnano > cssnano-preset-default > postcss-discard-empty@6.0.1" has incorrect peer dependency "postcss@^8.4.31". warning "@wordpress/scripts > cssnano > cssnano-preset-default > postcss-discard-overridden@6.0.1" has incorrect peer dependency "postcss@^8.4.31". warning "@wordpress/scripts > cssnano > cssnano-preset-default > postcss-merge-longhand@6.0.2" has incorrect peer dependency "postcss@^8.4.31". warning "@wordpress/scripts > cssnano > cssnano-preset-default > postcss-merge-rules@6.0.3" has incorrect peer dependency "postcss@^8.4.31". warning "@wordpress/scripts > cssnano > cssnano-preset-default > postcss-minify-font-values@6.0.1" has incorrect peer dependency "postcss@^8.4.31". warning "@wordpress/scripts > cssnano > cssnano-preset-default > postcss-minify-gradients@6.0.1" has incorrect peer dependency "postcss@^8.4.31". warning "@wordpress/scripts > cssnano > cssnano-preset-default > postcss-minify-params@6.0.2" has incorrect peer dependency "postcss@^8.4.31". warning "@wordpress/scripts > cssnano > cssnano-preset-default > postcss-minify-selectors@6.0.2" has incorrect peer dependency "postcss@^8.4.31". warning "@wordpress/scripts > cssnano > cssnano-preset-default > postcss-normalize-charset@6.0.1" has incorrect peer dependency "postcss@^8.4.31". warning "@wordpress/scripts > cssnano > cssnano-preset-default > postcss-normalize-display-values@6.0.1" has incorrect peer dependency "postcss@^8.4.31". warning "@wordpress/scripts > cssnano > cssnano-preset-default > postcss-normalize-positions@6.0.1" has incorrect peer dependency "postcss@^8.4.31". warning "@wordpress/scripts > cssnano > cssnano-preset-default > postcss-normalize-repeat-style@6.0.1" has incorrect peer dependency "postcss@^8.4.31". warning "@wordpress/scripts > cssnano > cssnano-preset-default > postcss-normalize-string@6.0.1" has incorrect peer dependency "postcss@^8.4.31". warning "@wordpress/scripts > cssnano > cssnano-preset-default > postcss-normalize-timing-functions@6.0.1" has incorrect peer dependency "postcss@^8.4.31". warning "@wordpress/scripts > cssnano > cssnano-preset-default > postcss-normalize-unicode@6.0.2" has incorrect peer dependency "postcss@^8.4.31". warning "@wordpress/scripts > cssnano > cssnano-preset-default > postcss-normalize-url@6.0.1" has incorrect peer dependency "postcss@^8.4.31". warning "@wordpress/scripts > cssnano > cssnano-preset-default > postcss-normalize-whitespace@6.0.1" has incorrect peer dependency "postcss@^8.4.31". warning "@wordpress/scripts > cssnano > cssnano-preset-default > postcss-ordered-values@6.0.1" has incorrect peer dependency "postcss@^8.4.31". warning "@wordpress/scripts > cssnano > cssnano-preset-default > postcss-reduce-initial@6.0.2" has incorrect peer dependency "postcss@^8.4.31". warning "@wordpress/scripts > cssnano > cssnano-preset-default > postcss-reduce-transforms@6.0.1" has incorrect peer dependency "postcss@^8.4.31". warning "@wordpress/scripts > cssnano > cssnano-preset-default > postcss-svgo@6.0.2" has incorrect peer dependency "postcss@^8.4.31". warning "@wordpress/scripts > cssnano > cssnano-preset-default > postcss-unique-selectors@6.0.2" has incorrect peer dependency "postcss@^8.4.31". warning "@wordpress/scripts > cssnano > cssnano-preset-default > postcss-merge-longhand > stylehacks@6.0.2" has incorrect peer dependency "postcss@^8.4.31". warning "@wordpress/scripts > @wordpress/eslint-plugin > eslint-plugin-jest > @typescript-eslint/utils > @typescript-eslint/typescript-estree > tsutils@3.21.0" has unmet peer dependency "typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta". [4/4] π¨ Building fresh packages... Deprecation Notice: Using ${var} in strings is deprecated, use {$var} instead in phar:///usr/local/bin/composer/vendor/symfony/console/Command/DumpCompletionCommand.php:48 Deprecation Notice: Using ${var} in strings is deprecated, use {$var} instead in phar:///usr/local/bin/composer/vendor/symfony/console/Command/DumpCompletionCommand.php:56 Deprecation Notice: Using ${var} in strings is deprecated, use {$var} instead in phar:///usr/local/bin/composer/src/Composer/Autoload/AutoloadGenerator.php:875 Deprecation Notice: Using ${var} in strings is deprecated, use {$var} instead in phar:///usr/local/bin/composer/src/Composer/Autoload/AutoloadGenerator.php:880 Installing dependencies from lock file (including require-dev) Verifying lock file contents can be installed on current platform. Nothing to install, update or remove Package phpunit/php-token-stream is abandoned, you should avoid using it. No replacement was suggested. Generating autoload files 20 packages you are using are looking for funding. Use the `composer fund` command to find out more! Deprecation Notice: Using ${var} in strings is deprecated, use {$var} instead in phar:///usr/local/bin/composer/vendor/symfony/console/Command/DumpCompletionCommand.php:48 Deprecation Notice: Using ${var} in strings is deprecated, use {$var} instead in phar:///usr/local/bin/composer/vendor/symfony/console/Command/DumpCompletionCommand.php:56 Deprecation Notice: Using ${var} in strings is deprecated, use {$var} instead in phar:///usr/local/bin/composer/src/Composer/Autoload/AutoloadGenerator.php:875 Deprecation Notice: Using ${var} in strings is deprecated, use {$var} instead in phar:///usr/local/bin/composer/src/Composer/Autoload/AutoloadGenerator.php:880 Copying .eslintrc.js to /Users/juanmanuelgarrido/PROJECTS/2024/wporg-developer/.eslintrc.js... Done. Copying .prettierrc.js to /Users/juanmanuelgarrido/PROJECTS/2024/wporg-developer/.prettierrc.js... Done. Copying .stylelintrc to /Users/juanmanuelgarrido/PROJECTS/2024/wporg-developer/.stylelintrc... Done. Copying phpcs.xml.dist to /Users/juanmanuelgarrido/PROJECTS/2024/wporg-developer/phpcs.xml.dist... Done. Deprecation Notice: Using ${var} in strings is deprecated, use {$var} instead in phar:///usr/local/bin/composer/vendor/symfony/console/Command/DumpCompletionCommand.php:48 Deprecation Notice: Using ${var} in strings is deprecated, use {$var} instead in phar:///usr/local/bin/composer/vendor/symfony/console/Command/DumpCompletionCommand.php:56 Deprecation Notice: Using ${var} in strings is deprecated, use {$var} instead in phar:///usr/local/bin/composer/src/Composer/Autoload/AutoloadGenerator.php:875 Deprecation Notice: Using ${var} in strings is deprecated, use {$var} instead in phar:///usr/local/bin/composer/src/Composer/Autoload/AutoloadGenerator.php:880 Installing dependencies from lock file (including require-dev) Verifying lock file contents can be installed on current platform. Deprecation Notice: Using ${var} in strings is deprecated, use {$var} instead in phar:///usr/local/bin/composer/src/Composer/DependencyResolver/Problem.php:366 Your lock file does not contain a compatible set of packages. Please run composer update. Problem 1 - phar-io/manifest is locked to version 1.0.3 and an update of this package was not requested. - phar-io/manifest 1.0.3 requires php ^5.6 || ^7.0 -> your php version (8.3.0) does not satisfy that requirement. Problem 2 - phar-io/version is locked to version 2.0.1 and an update of this package was not requested. - phar-io/version 2.0.1 requires php ^5.6 || ^7.0 -> your php version (8.3.0) does not satisfy that requirement. Problem 3 - phpspec/prophecy is locked to version v1.10.3 and an update of this package was not requested. - phpspec/prophecy v1.10.3 requires php ^5.3|^7.0 -> your php version (8.3.0) does not satisfy that requirement. Problem 4 - phpunit/php-code-coverage is locked to version 6.1.4 and an update of this package was not requested. - phpunit/php-code-coverage 6.1.4 requires php ^7.1 -> your php version (8.3.0) does not satisfy that requirement. Problem 5 - phpunit/phpunit is locked to version 7.5.20 and an update of this package was not requested. - phpunit/phpunit 7.5.20 requires php ^7.1 -> your php version (8.3.0) does not satisfy that requirement. Problem 6 - sebastian/global-state is locked to version 2.0.0 and an update of this package was not requested. - sebastian/global-state 2.0.0 requires php ^7.0 -> your php version (8.3.0) does not satisfy that requirement. Problem 7 - phpunit/phpunit 7.5.20 requires php ^7.1 -> your php version (8.3.0) does not satisfy that requirement. - yoast/phpunit-polyfills 1.0.3 requires phpunit/phpunit ^4.8.36 || ^5.7.21 || ^6.0 || ^7.0 || ^8.0 || ^9.0 -> satisfiable by phpunit/phpunit[7.5.20]. - yoast/phpunit-polyfills is locked to version 1.0.3 and an update of this package was not requested. error Command failed with exit code 2. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
In conversation with @ryelle via Slack she mentioned the required PHP version for this repo is v7.4
Is there any specific PHP version required to run this repo? yes, 7.4
So, I updated the PHP version on my Mac. For reference, this is how I did it:
Tap the shivammathur/php
repository:
Tap the shivammathur/php
repository, which provides PHP versions not available in the default Homebrew formulae (as brew install php@7.4
returned Warning: No available formula with the name "php@7.4". Did you mean php@8.2, php@8.1 or php@8.0?
):
brew tap shivammathur/php
Install PHP 7.4:
brew install shivammathur/php/php@7.4
Link the v7.4 PHP version, as I had a previous PHP version installed
brew unlink php
brew link php@7.4 --force
Configure the Shell - to ensure it's the version the system uses by default, I added the PHP 7.4 binary to my path.
.zshrc
):
export PATH="$(brew --prefix php@7.4)/bin:$PATH"
source ~/.zshrc
After these changes I could verify that PHP 7.4 is now the default version on my terminal
php -v
I'm getting the following error when doing
yarn setup:tools
for the first time after cloning the repo locallySee full output when
yarn setup:tools