I’m not sure whether or not to start a new thread, but here’s an update of where I am currently with this issue.
I was able to get terminal to use php version 7.4.33, which means that I am now able to run composer install and yarn build in the theme with no errors.
However, when I try to open the website through MAMP in the browser i get the following error -
PHP Fatal error: Uncaught Error: Call to undefined method Dotenv\Dotenv::createUnsafeImmutable()
vlucas/dotenv appears to be installed, I can see the files in vendor > vlucas/dotenv
Here are the contents of my composer.json file -
{
"name": "roots/bedrock",
"type": "project",
"license": "MIT",
"description": "WordPress boilerplate with modern development tools, easier configuration, and an improved folder structure",
"homepage": "https://roots.io/bedrock/",
"authors": [
{
"name": "Scott Walkinshaw",
"email": "scott.walkinshaw@gmail.com",
"homepage": "https://github.com/swalkinshaw"
},
{
"name": "Ben Word",
"email": "ben@benword.com",
"homepage": "https://github.com/retlehs"
}
],
"keywords": [
"bedrock", "composer", "roots", "wordpress", "wp", "wp-config"
],
"support": {
"issues": "https://github.com/roots/bedrock/issues",
"forum": "https://discourse.roots.io/category/bedrock"
},
"repositories": [
{
"type": "composer",
"url": "https://wpackagist.org"
}
],
"require": {
"php": ">=7.1",
"composer/installers": "^1.8",
"vlucas/phpdotenv": "^4.1.3",
"oscarotero/env": "^1.2.0",
"roots/wordpress": "5.4",
"roots/wp-config": "1.0.0",
"roots/wp-password-bcrypt": "1.0.0",
"wpackagist-plugin/woocommerce": "^4.0",
"wpackagist-plugin/bootstrap-for-contact-form-7": "^1.4",
"wpackagist-plugin/contact-form-7": "^5.1",
"wpackagist-plugin/flamingo": "^1.9",
"wpackagist-plugin/widget-logic": "^5.10",
"wpackagist-plugin/wp-migrate-db": "^1.0",
"wpackagist-plugin/megamenu": "^2.7",
"wpackagist-plugin/woo-variation-swatches": "^1.0"
},
"require-dev": {
"squizlabs/php_codesniffer": "^3.5.4",
"roave/security-advisories": "dev-master"
},
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"allow-plugins": {
"composer/installers": true,
"roots/wordpress-core-installer": true
}
},
"minimum-stability": "dev",
"prefer-stable": true,
"extra": {
"installer-paths": {
"web/app/mu-plugins/{$name}/": ["type:wordpress-muplugin"],
"web/app/plugins/{$name}/": ["type:wordpress-plugin"],
"web/app/themes/{$name}/": ["type:wordpress-theme"]
},
"wordpress-install-dir": "web/wp"
},
"scripts": {
"post-root-package-install": [
"php -r \"copy('.env.example', '.env');\""
],
"test": [
"phpcs"
]
}
}
I am using nvm v10.5.3 in this project.