azukiapp / azk

azk is a lightweight open source development environment orchestration tool. Instantly & safely run any environment on your local machine.
http://azk.io
Apache License 2.0
899 stars 63 forks source link

keeps trying to remove node_modules directory. #584

Open FDiskas opened 8 years ago

FDiskas commented 8 years ago
$ azk doctor

      Version : 0.16.3
      Agent   : up
      Docker  : 1.9.1
      Use vm  : no

On first run got error

npm ERR! Linux 4.2.6-301.fc23.x86_64
npm ERR! argv "node" "/usr/local/bin/npm" "install" "bower"
npm ERR! node v0.12.7
npm ERR! npm  v2.14.1
npm ERR! path /azk/web/node_modules
npm ERR! code EBUSY
npm ERR! errno -16

npm ERR! EBUSY, rmdir '/azk/web/node_modules'

Azkfile.js

/**
 * Documentation: http://docs.azk.io/Azkfile.js
 */
// Adds the systems that shape your system
systems({
  web: {
    // Dependent systems
    depends: [],
    // More images:  http://images.azk.io
    image: {"docker": "azukiapp/php-fpm:5.6"},
    // Steps to execute before running instances
    provision: [
      "npm install bower",
      "node_modules/.bin/bower install --allow-root"
    ],
    workdir: "/azk/#{manifest.dir}",
    shell: "/bin/bash",
    wait: 20,
    mounts: {
      '/azk/#{manifest.dir}'             : path("."),
      '/etc/nginx/sites-enabled/'        : path("./nginx/"),
      '/azk/#{manifest.dir}/lib'         : persistent("lib"),
      '/azk/#{manifest.dir}/node_modules': persistent("node_modules"),
    },
    scalable: {"default": 1},
    http: {
      domains: [ "#{system.name}.#{azk.default_domain}" ]
    },
    ports: {
      // exports global variables
      http: "80/tcp"
    },
    envs: {
      // Make sure that the PORT value is the same as the one
      // in ports/http below, and that it's also the same
      // if you're setting it in a .env file
      APP_DIR: "/azk/#{manifest.dir}",
      PATH: 'node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin'
    }
  }
});
gullitmiranda commented 8 years ago

This issue occurs because bower is trying to remove the folder node_modules while it's a mounted folder inside the container, hence it's not possible to remove it.

It's needed to find out how to make bower delete only the content of that folder.