Reputation: 113
I have created EC2 instance on AWS with Ubuntu(14.04). I am trying to install arangodb application using foxx manager on this. I have connected to it using putty. I have installed the arangodb using sudo apt-get install arangodb. I have also got project from git on ubuntu machine. when I am trying to install application using foxx-manager install . /DataSandbox it gives error as
"StdOut: ArangoError 3103: failed to invoke module.
File: /var/lib/arangodb-apps/_db/_system/DataSandbox/APP/controllers/Reports.js
Cause: ArangoError 3100: cannot locate module
File: repositories/Reports"
When I check the file repositories/Reports it exists and when I check /var/lib/arangodb-apps path it is there until Datasandbox like /var/lib/arangodb-apps/_db/_system/DataSandbox/. Datasandbox folder is empty in arangodb-apps.
Same process I did in different ubuntu machine which is not created from AWS. On that it was got installed successfully.
Can anyone please guide me on this error cannot locate module?
Thanks in Advance.
Upvotes: 1
Views: 321
Reputation: 10892
Can you clarify whether the two machines you saw different results on (i.e. the one it worked on and the one it didn't) were running the same version of ArangoDB and which version(s) you were using?
The error indicates there is a require
call in controllers/Reports.js
for repositories/Reports
which could not be resolved. If the machine it worked with was running an older version of ArangoDB it could be that you are being bit by the change in how require
resolves certain names: https://www.arangodb.com/2015/11/foxx-module-resolution-will-change-in-2-8/
I think you literally have an expression like this in your controller:
require('repositories/Reports')
This doesn't work in 2.8 and later as it will attempt to find a (third-party or ArangoDB) module called "repositories/Reports" and fails.
Instead that should be a relative path from the controller file to the repository file:
require('../repositories/Reports')
Upvotes: 2