Using Vagrant


#1

Hello there,
im trying out vagrant right now and have some issues…

I have edited the Vagrantfile to share a folder between host and the virtual machine.

I login to the VM with Bitvise SSH-Client…

On the VM in the shared folder as root (super su) i have created a new Ionic-App “ionic start myapp sidemenu” as root because permissions.

When i want to add android “ionic platform add android” not as root i get this error:

Error: /home/vagrant/.cordova/lib/android/cordova/3.5.1/bin/create: Command failed with exit code 1
at ChildProcess.whenDone (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:135:23)
at ChildProcess.EventEmitter.emit (events.js:98:17)
at maybeClose (child_process.js:743:16)
at Process.ChildProcess._handle.onexit (child_process.js:810:5)

another test as root not in an shared folder (needn’t have to do with that) “ionic platform add android”:

/root/.cordova/lib/android/cordova/3.5.1/bin/node_modules/q/q.js:126
                throw e;
                      ^ Error: An error occurred while listing Android targets
at /root/.cordova/lib/android/cordova/3.5.1/bin/lib/check_reqs.js:87:29
at _rejected (/root/.cordova/lib/android/cordova/3.5.1/bin/node_modules/q/q.js:808:24)
at /root/.cordova/lib/android/cordova/3.5.1/bin/node_modules/q/q.js:834:30
at Promise.when (/root/.cordova/lib/android/cordova/3.5.1/bin/node_modules/q/q.js:1079:31)
at Promise.promise.promiseDispatch (/root/.cordova/lib/android/cordova/3.5.1/bin/node_modules/q/q.js:752:41)
at /root/.cordova/lib/android/cordova/3.5.1/bin/node_modules/q/q.js:574:44
at flush (/root/.cordova/lib/android/cordova/3.5.1/bin/node_modules/q/q.js:108:17)    at process._tickCallback (node.js:415:13) Error: /root/.cordova/lib/android/cordova/3.5.1/bin/create: Command failed with exit code 8
at ChildProcess.whenDone (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:135:23)
at ChildProcess.EventEmitter.emit (events.js:98:17)
at maybeClose (child_process.js:743:16)
at Process.ChildProcess._handle.onexit (child_process.js:810:5)

Another error when trying to install a nodeserver (“npm install” with package.json: express/body-parser/livereload) in the shared folder:

...
npm http GET https://registry.npmjs.org/mime/1.2.11 
npm http 304 https://registry.npmjs.org/destroy/1.0.3
npm http 304 https://registry.npmjs.org/mime/1.2.11
npm ERR! Error: UNKNOWN, symlink '../ws/bin/wscat'
npm ERR! If you need help, you may report this log at:
npm ERR!     <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR!     <npm-@googlegroups.com>
npm ERR! System Linux 3.13.0-34-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install"
npm ERR! cwd /vagrant_projects/test
npm ERR! node -v v0.10.25
npm ERR! npm -v 1.3.10
npm ERR! path ../ws/bin/wscat
npm ERR! code UNKNOWN
npm ERR! errno -1
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     /vagrant_projects/test/npm-debug.log
npm ERR! not ok code 0

the last error has something to do with the shared folder on the vm. Works fine direct on the host…

Edit: It looks like all works fine if i keep in the vagrant/home-directory as vagrant-user, except for the last error :frowning: it comes from the livereload-package

my shared-folder config in the vagrantfile:

Share an additional folder to the guest VM. The first argument is

# the path on the host to the actual folder. The second argument is
  # the path on the guest to mount the folder. And the optional third
  # argument is a set of non-required options.
  config.vm.synced_folder “P:/vagrant”, “/home/vagrant_projects”