Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Mte90 opened this issue Mar 4, 2022 · 10 comments
Open

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

Mte90 opened this issue Mar 4, 2022 · 10 comments

Comments

@Mte90
Copy link
Member

Mte90 commented Mar 4, 2022

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

@Mte90 Mte90 added the type:bug label Mar 4, 2022
@tomjn
Copy link
Member

tomjn commented Mar 4, 2022

Could this be related to the grunt/nvm provisioning? Does this issue happen on #2581 ?

@Mte90
Copy link
Member Author

Mte90 commented Mar 4, 2022

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
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
Copy link
Member Author

Mte90 commented Mar 7, 2022

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
Copy link
Member

tomjn commented Mar 7, 2022

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
Copy link
Member Author

Mte90 commented Mar 7, 2022

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
Copy link
Member Author

Mte90 commented Mar 7, 2022

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
Copy link
Member Author

Mte90 commented Mar 8, 2022

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
Copy link
Member

tomjn commented Mar 8, 2022

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

@Mte90
Copy link
Member Author

Mte90 commented Mar 8, 2022

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
Copy link
Member

tomjn commented Mar 8, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants