-
Notifications
You must be signed in to change notification settings - Fork 14
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
node_modules folder inside host, not symlinked #33
base: master
Are you sure you want to change the base?
Conversation
To me worked everything now :-) |
I was just thinking that this mount point doesn't persist on a new boot of the VM so every time is required a provision. |
if it's in |
No I was talking about the |
Any updates for this? |
I don't have the bandwidth to look at this, it may be several weeks before of time before it bubbles to the top of the queue and I can look at it myself ( VVV and non-VVV ). |
also how does this handle the user running commands on the host not the guest? Is the node_modules not visible in the host because it's a symlink to a VM only folder? |
The host cannot see the folder as it is symlinked inside the VM, just see a file with the symlink (on linux) to a folder that not exists in the host. part that the other issue is the |
would it make more sense to instead tell |
The problem is that npm has issues on using a shared folder for node_modules, so if it is inside the machine everything works. |
we don't know for sure if someone will use the host or the guest though, it either needs to work with both, or be configurable |
Well it will never work anyway. If in the host I have nodejs 23 and VVV has nodejs 12 something will not work. that was basically the reason why I had those problems otherwise I executed npm in the host machine and not inside VVV. |
a lot of people will use watchers on the host as it's more reliable. NVM is installed inside the VM so users can switch to the appropriate node version, likewise they could do that on the host.
Note there are also other consequences, those packages won't be indexable by editors and tools on the host. At a minimum this would need to be optional, in addition to node modules, watchers don't work well on shared folders and that applies to core itself not just the node modules folder
|
This is all solved by |
Well I don't have nvm locally and don't want to install it just to have a specific nodejs version for wordpress. |
arguably it's better to install NodeJS only through nvm or a similar tool. Even core has support for it: https://github.com/WordPress/wordpress-develop/blob/trunk/.nvmrc It's also the secret sauce that lets VVV always have the correct Node version for core:
|
I've tried to fix a merge conflict, @Mte90 for this there should be an option, I can see it being useful for some people while breaking things for others. I'd prefer things like this be trialled as parameters then promoted to defaults once we're sure all is good |
Well as today isn't good anyway as it is a mess to use npm inside a VM. It uses all the ram and crash at the end also with a symlinked folder, we should try yarn or pnpm to fix the issue at the top. |
Following hashicorp/vagrant#11842
In this way NPM inside develop works again inside VVV.
I am not sure if the folder path is right or not.
Still testing at 100%