npm and Windows host paths length

冠旭服務npm and Windows host paths length

123
  • 定價:NT20
  • 優惠價:NT20
  • 分享內容
    jgoux commented on Mar 4, 2014

    I made it work with the SymLinks way :

    Host : Windows 8.1 x64
    Guest : Ubuntu 12.04 x64
    Vagrant version 1.4.3
    Virtualbox version 4.3.6

    1) Add this line to your Vagrantfile to enable symlinks in the shared folder (inside the "config.vm.provider :virtualbox do |vb|" section)
    vb.customize ["setextradata", :id, "VBoxInternal2/SharedFoldersEnableSymlinksCreate/vagrant", "1"]

    2) From Windows host terminal in admin mode
    fsutil behavior set SymlinkEvaluation L2L:1 R2R:1 L2R:1 R2L:1 # Command found here :mitchellh/vagrant#713 (comment)
    vagrant up && vagrant ssh

    3) From Ubuntu guest terminal
    mkdir ~/node_modules
    ln -s ~/node_modules /vagrant/yourProjectRoot/node_modules

    4) You can now install npm packages in your project directory without worrying about paths length (in admin mode or not)
    cd /vagrant/yourProjectRoot
    npm init
    npm install gulp gulp-clean gulp-concat gulp-jshint gulp-minify-css gulp-ngmin gulp-rename gulp-ruby-sass gulp-uglify gulp-imagemin gulp-cache --save-dev

    npm install --no-bin-links

     

    Hi @jgoux. I have the same problem, with gulp.
    We found that mounting the node_modules folder instead of making a symlinc was a better solution,
    but not the easiest one to work with, because mount folders does not persist after VM shutdown.

    cd /shared_workspace/project
    sudo mount -o bind ~/node_modules node_modules


    參考 :https://github.com/fideloper/Vaprobash/issues/183

Related Items 相關產品

回列表