Varying-Vagrant-Vagrants / VVV

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

Bug: NPM crash on custom-template-site-develop #2584

Open Mte90 opened 2 years ago

Mte90 commented 2 years 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?

New fresh install

Whats the problem?

Running: /tmp/vagrant-shell20220304-133275-k29h.sh
    default:  ▷ Running the 'site-wordpress-develop' provisioner...
    default:  * Pulling down the master branch of https://github.com/Varying-Vagrant-Vagrants/custom-site-template-develop
    default:  * Downloading wordpress-develop provisioner, git cloning from https://github.com/Varying-Vagrant-Vagrants/custom-site-template-develop into /srv/www/wordpress-develop
    default: Cloning into '/srv/www/wordpress-develop'...
    default:  * wordpress-develop provisioner clone successful
    default: npm ERR! Maximum call stack size exceeded
    default: 
    default: npm ERR! A complete log of this run can be found in:
    default: npm ERR!     /home/vagrant/.npm/_logs/2022-03-04T15_55_37_814Z-debug.log
    default: internal/modules/cjs/loader.js:905
    default:   throw err;
    default:   ^
    default: 
    default: Error: Cannot find module 'findup-sync'
    default: Require stack:
    default: - /srv/www/wordpress-develop/public_html/node_modules/grunt/lib/grunt/file.js
    default: - /srv/www/wordpress-develop/public_html/node_modules/grunt/lib/grunt.js
    default: - /usr/lib/node_modules/grunt-cli/bin/grunt
    default: - /usr/lib/node_modules/grunt/bin/grunt
    default:     at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15)
    default:     at Function.Module._load (internal/modules/cjs/loader.js:746:27)
    default:     at Module.require (internal/modules/cjs/loader.js:974:19)
    default:     at require (internal/modules/cjs/helpers.js:101:18)
    default:     at Object.<anonymous> (/srv/www/wordpress-develop/public_html/node_modules/grunt/lib/grunt/file.js:15:15)
    default:     at Module._compile (internal/modules/cjs/loader.js:1085:14)
    default:     at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
    default:     at Module.load (internal/modules/cjs/loader.js:950:32)
    default:     at Function.Module._load (internal/modules/cjs/loader.js:790:12)
    default:     at Module.require (internal/modules/cjs/loader.js:974:19) {
    default:   code: 'MODULE_NOT_FOUND',
    default:   requireStack: [
    default:     '/srv/www/wordpress-develop/public_html/node_modules/grunt/lib/grunt/file.js',
    default:     '/srv/www/wordpress-develop/public_html/node_modules/grunt/lib/grunt.js',
    default:     '/usr/lib/node_modules/grunt-cli/bin/grunt',
    default:     '/usr/lib/node_modules/grunt/bin/grunt'
    default:   ]
    default: }
    default: PHP Notice:  Undefined index: HTTP_HOST in /srv/www/wordpress-develop/public_html/src/wp-includes/functions.php on line 5983
    default: Notice: Undefined index: HTTP_HOST in /srv/www/wordpress-develop/public_html/src/wp-includes/functions.php on line 5983
    default: internal/modules/cjs/loader.js:905
    default:   throw err;
    default:   ^
    default: 
    default: Error: Cannot find module 'findup-sync'
    default: Require stack:
    default: - /srv/www/wordpress-develop/public_html/node_modules/grunt/lib/grunt/file.js
    default: - /srv/www/wordpress-develop/public_html/node_modules/grunt/lib/grunt.js
    default: - /usr/lib/node_modules/grunt-cli/bin/grunt
    default: - /usr/lib/node_modules/grunt/bin/grunt
    default:     at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15)
    default:     at Function.Module._load (internal/modules/cjs/loader.js:746:27)
    default:     at Module.require (internal/modules/cjs/loader.js:974:19)
    default:     at require (internal/modules/cjs/helpers.js:101:18)
    default:     at Object.<anonymous> (/srv/www/wordpress-develop/public_html/node_modules/grunt/lib/grunt/file.js:15:15)
    default:     at Module._compile (internal/modules/cjs/loader.js:1085:14)
    default:     at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
    default:     at Module.load (internal/modules/cjs/loader.js:950:32)
    default:     at Function.Module._load (internal/modules/cjs/loader.js:790:12)
    default:     at Module.require (internal/modules/cjs/loader.js:974:19) {
    default:   code: 'MODULE_NOT_FOUND',
    default:   requireStack: [
    default:     '/srv/www/wordpress-develop/public_html/node_modules/grunt/lib/grunt/file.js',
    default:     '/srv/www/wordpress-develop/public_html/node_modules/grunt/lib/grunt.js',
    default:     '/usr/lib/node_modules/grunt-cli/bin/grunt',
    default:     '/usr/lib/node_modules/grunt/bin/grunt'
    default:   ]
    default: }
    default:  * sourcing of vvv-init.sh reported success
    default:  * VVV is adding an Nginx config from /srv/www/wordpress-develop/provision/vvv-nginx.conf
    default:  * Reloading Nginx

How do we reproduce it?

No response

VVV Status screen

__ __ __ __
\ V\ V\ V / v3.9.0 Path:"/home/www/VVV"
 \_/\_/\_/  git::php-provision-site(d7666eb)

Platform: linux-gnu shell:/bin/bash systemd  vagrant-goodhosts CaseSensitiveFS shared_db_folder_disabled
Vagrant: v2.2.19, virtualbox: v6.1.32

Docs:       https://varyingvagrantvagrants.org/
Contribute: https://github.com/varying-vagrant-vagrants/vvv
Dashboard:  http://vvv.test

Which Operating System are you using?

Linux

Which provider are you using?

VirtualBox

tomjn commented 2 years ago

Could this be related to the grunt/nvm provisioning? Does this issue happen on https://github.com/Varying-Vagrant-Vagrants/VVV/pull/2581 ?

Mte90 commented 2 years ago

I am not sure as it is a bug inside the provisioner and looking on internet is an issue of the package-lock.json -> https://dano.me.uk/code/npm-maximum-call-stack-size-exceeded/

Or the clean the NPM cache:

npm cache clean --force

I need some tests...

Daniel Pomfret
NPM: Maximum call stack size exceeded
You may have cloned a project and tried running ‘npm install’ only to find the following error message: error Maximum call stack size exceeded There’s multiple ways I’ve fou…
Mte90 commented 2 years ago

So after the provisioning, trying a npm install inside Vagrant report an error. So I am trying to remove the package-lock.json and node_modules folder, my guess is that that file is generated on osx or windows and on linux there are some conflicts.

tomjn commented 2 years ago

I would verify this happens reliably and on the NVM branch as that significantly changes the Node situation, the version of NPM used may change as a result.

Also if ti can't find findup or grunt modules that implies the issue lays elsewhere. Also remember that the terminal output is not the full output, the provisioner log will have more informatio

Mte90 commented 2 years ago

I see the issue is happening also locally on my host machine in the same folder, reading on internet seems that the dependence tree is too much bigger in wordpress. I am using npm install --force or the host machine is not able to install it. I will test the same command inside vagrant.

Mte90 commented 2 years ago

Seems that npm install --production --force works but this doesn't install the dev stuff so I have to try with two different commands maybe in this way is able to download everything.

Mte90 commented 2 years ago

So one of the errors tar TAR_ENTRY_ERROR ENOMEM: not enough memory with 4gb of ram. I updated also the npm version in the VM that fix some troubles. Also seems that run npm install --force twice fix the issues I am facing (with npm updated).

tomjn commented 2 years ago

so building core requires more than 4gb of ram for the VM is what you're saying?

Mte90 commented 2 years ago

I am afraid of this but other people that can do some test with the provisioner can be helpful. I was thinking of a flag to not execute npm, so people like me that are not interested in the JS can work on the core.

tomjn commented 2 years ago

Is it not necessary to build those files? We’ve had tickets in the past where people had allocated 2GB of memory and it didn’t provision

I don’t mind us having a flag though I’d want us to document it, including links to where people can install the various tools on their host

On Tue, 8 Mar 2022 at 16:09, Daniele Scasciafratte @.***> wrote:

I am afraid of this but other people that can do some test with the provisioner can be helpful. I was thinking of a flag to not execute npm, so people like me that are not interested in the JS can work on the core.

— Reply to this email directly, view it on GitHub https://github.com/Varying-Vagrant-Vagrants/VVV/issues/2584#issuecomment-1061944297, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAOLZZNDH4X3ZQ2LBIRWHDU653RZANCNFSM5P55J4HQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you commented.Message ID: @.***>