Varying-Vagrant-Vagrants / VVV

An open source Vagrant configuration for developing with WordPress
https://varyingvagrantvagrants.org
MIT License
4.55k stars 849 forks source link

Bug: Contribute template doesn't work #2655

Closed Mte90 closed 1 year ago

Mte90 commented 1 year ago

Are you using the latest stable or develop branch version of VVV?

Yes (develop)

Is it a new VVV, or an existing VVV that used to work?

Existing, worked but now broken

Did you use a CustomFile?

No (default)

Whats the problem?

As now https://github.com/Varying-Vagrant-Vagrants/custom-site-template-develop you get a 403.

There are various NPM issues but apart that the nginx.conf generated https://github.com/Varying-Vagrant-Vagrants/custom-site-template-develop/blob/master/provision/vvv-nginx-default.conf#L5 point to the build folder also if it is empty.

Changing the nginx conf to src folder shows this page:

immagine

The issues on NPM are now on installing as there is an issue with a package:

vagrant@vvv:/srv/www/wordpress-develop/public_html$ npm install
npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path /srv/www/wordpress-develop/public_html/node_modules/@babel/helper-compilation-targets/node_modules/electron-to-chromium/package.json.697929498
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, open '/srv/www/wordpress-develop/public_html/node_modules/@babel/helper-compilation-targets/node_modules/electron-to-chromium/package.json.697929498'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent 

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/vagrant/.npm/_logs/2023-01-27T15_11_10_765Z-debug.log

I am on this

How do we reproduce it?

No response

What is the output of vagrant status

__ __ __ __
\ V\ V\ V / v3.11 Ruby:3.1.2, Path:"/home/www/VVV"
 \_/\_/\_/  git::develop(fb684b5)

Platform: linux-gnu shell:/bin/bash systemd  vagrant-goodhosts CaseSensitiveFS shared_db_folder_disabled
Vagrant: v2.3.4, virtualbox: v7.0.6

Which Operating System are you using?

Apple MacOS (Intel)

Which provider are you using?

VirtualBox 7

Mte90 commented 1 year ago

Probably the issue is the fact that NPM takes woo much memory and the VM with 4096mb of ram and 2 cores is not enough to execute npm all together. Now the error in the package changed as example.

I am trying now commands like NODE_OPTIONS=--max_old_space_size=1000; npm install as example

tomjn commented 1 year ago

I think working out of the src folder was always going to generate that kind of output, hence why we serve the build folder

tomjn commented 1 year ago

How much RAM does the VM need to be able to do this? If we know the minimum or recommended it would be good to make the site provisioner check and warn the user. This also helps with situations where someone tries to limit the VMs footprint putting the RAM as low as 2GB or 1GB then encountering issues provisioning the core contributor site

Mte90 commented 1 year ago

Tried with also 10gb of ram and more cpu the error is still there so I have no idea what is happening...

Mte90 commented 1 year ago

It is a bug in wordpress package.json and not in VVV.

Mte90 commented 1 year ago

Confirmed that this fixed we are evaluating what to do https://github.com/hashicorp/vagrant/issues/11842