node.js - Window平台下使用Vagrant进行Nodejs开发,大家使用怎样的同步方式
PHPz
PHPz 2017-04-17 11:52:47
0
4
719

搭建了Win8(host)+Vagrant+Virtualbox+ubuntu(guest)的环境,在同步方式的问题上遇到了一些问题

  • 使用Virtualbox共享文件夹
    将node_modules链接到ubuntu本地分区,工作正常,但是文件访问效率比较差,在执行构建任务时,构建速度与与本地磁盘的构建相差4-5倍。

  • 使用rsync同步文件夹
    在构建速度上可以得到保证,但是单向文件夹同步用起来会有一些不方便。

  • 使用smb同步文件夹
    在使用smb进行文件夹同步时,遇到共享文件夹内无法建立node_modules的软链接的问题,google了多种方案未果。

想知道大家使用Vagrant在window下开发nodejs时都使用怎样的文件夹同步方式。

PHPz
PHPz

学习是最好的投资!

reply all(4)
小葫芦

I don’t use Vagrant, but directly use Win7 + Virtual Box + Ubuntu.
My method:
1. Share a folder under Windows (don’t ask me how to share it, use Baidu by yourself, the same below)
2. Use mount.cifs to mount this folder to a directory in Ubuntu
3. Then just access this directory directly

The efficiency is acceptable.

rsync is very inconvenient. In fact, I have always wanted to change to using NFS to share files, but the efficiency of shared folders in Windows is acceptable, and I am too lazy to do it.

左手右手慢动作

Conclusion,
First of all, thank you all for your replies. As for the friend who is always complaining, I won’t comment further.

First of all, let’s talk about why we have to do everything we can to develop directly under window. There are three main points

  1. Try something new, and what I know about ruby/node is that sometimes some modules don’t have good solutions under window
  2. It’s purely for convenience. I don’t want to install a lot of dependencies in the window that I actually use, such as databases, slow down the startup speed, eat up memory, etc. After all, coach I still want to play Dota.
  3. The build environment mentioned earlier mainly refers to ember-cli. As of now, the build speed difference between this build tool on window and unix-like systems is still relatively large.

The final solution chosen is window + vagrant + ubuntu +virtualbox

Ubuntu builds Samba and opens files for editing directly under window, which basically solves the problems encountered before. The build speed and file synchronization speed have basically reached a level that I am satisfied with.

黄舟

Just use webstorm directly under win. Why use a virtual machine? ?

Peter_Zhu

phpstorm webtore rubymine pycharm jetbrain both have ftp direct editing and ftp autoupload functions

You can also change to a mac...

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template