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

grunt packaged not installed for wordpress-develop on first vagrant up #825

Closed
ericandrewlewis opened this issue Feb 7, 2016 · 8 comments
Labels
Milestone

Comments

@ericandrewlewis
Copy link
Contributor

The grunt package should be installed, as it's specified in wordpress-develop's package.json.

However, it is not installed on first vagrant up, although other packages are installed.

To investigate, I made logs of npm install appear rather than be swallowed to dev/null, and see this output.

If I login to the machine after provisioning and run npm install, it installs grunt as well as grunt-jsvalidate.

vagrant@vvv:/srv/www/wordpress-develop$ npm install
[email protected] /srv/www/wordpress-develop
├─┬ [email protected] 
│ └── [email protected] 
└─┬ [email protected] 
  └── [email protected] 
@jeremyfelt jeremyfelt added this to the 1.3.0 milestone Feb 7, 2016
@jeremyfelt
Copy link
Member

Good catch, I haven't tried using grunt inside the VM in a while.

It seems like the related issue could be this line: UNMET PEER DEPENDENCY grunt@~0.4.0.

I wonder if this is somehow related to #788 and #779.

@jeremyfelt jeremyfelt removed this from the 1.3.0 milestone Feb 21, 2016
@jeremyfelt
Copy link
Member

I think we need to test this a bit more. I ran through vagrant up from scratch last week and grunt installed fine as part of provisioning.

@jeremyfelt
Copy link
Member

I did another vagrant up with a blank box today as part of 1.3.0 testing and things seemed ok. I'm wondering if this was a one off issue.

@ntwb
Copy link
Contributor

ntwb commented Apr 5, 2016

GruntJS 1.0.0 was released today http://gruntjs.com/blog/2016-04-04-grunt-1.0.0-released

Grunt-cli is also now 1.x, currently 1.2.0 https://github.com/gruntjs/grunt-cli

On a fresh VVV setup and an initial vagrant up and subsequent vagrant up --provision I've currently got:

vagrant@vvv:/srv/www/wordpress-develop$ grunt --version
grunt-cli v1.2.0
grunt v0.4.5

This all appears correct as Grunt 0.4.5 is what we currently install for WordPress (src)

@GaryJones
Copy link
Contributor

I'm not sure if this is related, but I recently uninstalled global Grunt on my host machine (preferring all projects to include their own dependencies), and I'm now getting the following:
screenshot 2016-05-09 10 28 59
After updating everything (VVV develop branch, latest box version, halted then vagrant up --provision), I then still got the same warning, but provisioning seemed to carry on:
screenshot 2016-05-09 10 32 43

There was an entry to say that Grunt was being installed, but even at the end, the error persisted:

screenshot 2016-05-09 10 37 40

@jeremyfelt
Copy link
Member

I was able to reproduce this today on a fresh vagrant up with the develop branch. The resulting npm-debug.log has a couple errors at the end that may be relevant.

It then took too many destroys and re-provisions, but I think I found how to reproduce.

In provision.sh, we have noroot npm install &>/dev/null for wordpress-develop on the first provision.

If I allow npm output to be shown by changing that to noroot npm install for a fresh provision, it works fine. If I change it back to noroot npm install &>/dev/null for a fresh position, it has the same error.

Now that I'm there, I haven't dug into possible reasons yet, but a short term fix may just be to allow for the output.

@jeremyfelt
Copy link
Member

This appears to be related, if not the issue: npm/npm#9633

@jeremyfelt jeremyfelt added this to the Next Release milestone Aug 20, 2016
jeremyfelt added a commit that referenced this issue Aug 20, 2016
The installation of local npm packages was running into trouble
due to what is likely a race condition caused by slow shared drives
between the host and guest machines. This is mostly a guess, but
seems plausible.

We can instead handle the initial SVN checkout, the npm package
installation, and the initial build via grunt in the VM's `/tmp`
machine. Once this is all prepped, it is then moved to the final
location in `/srv/www/wordpress-develop` before other scripts that
install WordPress run.

Anything involving files runs quite a bit quicker during the initial
setup. The move of the directory takes a long while though, which
kind of negates the original speed. :)

But speed isn't the problem, incomplete local npm packages is.

Fixes #825.
@lock
Copy link

lock bot commented Feb 22, 2020

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Feb 22, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants