woocommerce / woocommerce

A customizable, open-source ecommerce platform built on WordPress. Build any commerce solution you can imagine.
https://woocommerce.com
9.43k stars 10.77k forks source link

pnpm install and builds fail #41851

Open DragonEnergy opened 12 months ago

DragonEnergy commented 12 months ago

Prerequisites

Describe the bug

After cloning repo into dev environment. as directed by documentation to run

pnpm install && composer install

then this error is produced

postinstall$ pnpm git:update-hooks
│ > woocommerce-monorepo@ git:update-hooks C:\dev\robccs-woo-plugin\vvv-local\www\wordpress-one\public_html\wp-content\plugins\woocommerce      
│ > if test -d .git; then rm -r .git/hooks && mkdir -p .git/hooks && husky install; else husky install; fi
│ -d was unexpected at this time.
│  ELIFECYCLE  Command failed with exit code 1.
└─ Failed in 775ms at C:\dev\robccs-woo-plugin\vvv-local\www\wordpress-one\public_html\wp-content\plugins\woocommerce
packages/js/tracks prepare$ composer install
│ 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 symfony/debug is abandoned, you should avoid using it. Use symfony/error-handler instead.
│ Generating autoload files
│ 4 packages you are using are looking for funding.
│ Use the `composer fund` command to find out more!
└─ Done in 470ms
 ELIFECYCLE  Command failed with exit code 1.

node v16.14.1 pnpm v8.11.0 PHP 8.1.17 Composer version 2.6.5 2023-10-06 10:11:52 tried on Powershell and WSL from same /dir C:/dev/vvv-loca/etc...

Expected behavior

Im expecting to to install woocommerce for plugin development locally using VVV

Actual behavior

I get an error when running

pnpm install

Steps to reproduce

from /plugins

git clone https://github.com/woocommerce/woocommerce.git cd woocommerce

pnpm install ..

WordPress Environment

Woocommerce is not installed yet

Isolating the problem

rrennick commented 11 months ago

git clone https://github.com/woocommerce/woocommerce.git cd woocommerce

The documentation needs to be updated. Try cd woocommerce/plugins/woocommerce then run pnpm install.

I'll leave this open as a reminder that the documentation needs to be updated.

ecgan commented 11 months ago

@DragonEnergy , from your error log "-d was unexpected at this time", it seems like you are using Windows operating system (Reference: How to check if a directory exists in Windows?).

The test command is a command line utility in Unix-like OS (Linux / Mac OS). So you may need to find a way to run those commands in Windows.