appbuilder, sudo and ubuntu 14.04

3 posts, 0 answers
  1. Taylor
    Taylor avatar
    2 posts
    Member since:
    Sep 2014

    Posted 08 Oct 2014 Link to this post

    I tried installing appbuilder using sudo npm install -g appbuilder

    When I try to run appbuilder, it says:

    Error: Future resolved more than once
        at Object.Future.throw (/usr/local/lib/node_modules/appbuilder/node_modules/fibers/future.js:272:10)
        at WriteStream.<anonymous> (/usr/local/lib/node_modules/appbuilder/lib/common/file-system.js:129:32)
        at WriteStream.g (events.js:180:16)
        at WriteStream.EventEmitter.emit (events.js:95:17)
        at WriteStream.<anonymous> (fs.js:1660:12)
        at OpenReq.Req.done (/usr/local/lib/node_modules/appbuilder/node_modules/watchr/node_modules/safefs/node_modules/graceful-fs/graceful-fs.js:143:5)
        at OpenReq.done (/usr/local/lib/node_modules/appbuilder/node_modules/watchr/node_modules/safefs/node_modules/graceful-fs/graceful-fs.js:63:22)
        at Object.oncomplete (fs.js:107:15)

    It works if I run it with sudo appbuilder

    The problem is that if I create any files, the permissions of all the files that the appbuilder creates are all bound to the sudo privilege.  I can't edit files because they are write protected to normal users.  I tried installing the appbuilder module in my home directory, and running the script in the bin in there, but it raises the same Future problem.

  2. Todor
    Todor avatar
    63 posts

    Posted 09 Oct 2014 Link to this post

    Hi Taylor,

    I am sorry that you have issues using AppBuilder CLI. There are two problems at work here. The lesser one is that we handle badly errors raised from file I/O (the "Future resolved more than once" issue). This is a known bug, which we have already fixed for the upcoming 2.6 release.

    The bigger issue is that we do not work well in scenarios where node requires sudo. We will gradually improve our code until we fully support this case. This won't be ready for our next release, though.

    In the mean time, I would suggest to clean up files already created with root owner. To do this, delete the entire directory ~/.appbuilder-cli. If this do not help, you need to use node installed as non-root. We recommend using NVM as described here.  

    Let me know if this helped you resolve the issues.


    Visit the Telerik Verified Plugins Marketplace and get the custom Cordova plugin you need, already tweaked to work seamlessly with AppBuilder.

  3. Taylor
    Taylor avatar
    2 posts
    Member since:
    Sep 2014

    Posted 09 Oct 2014 Link to this post

    What ended up working was deleting the ~/.appbuilder-cli folder and then running npm install appbuilder in the home directory (it went to ~/node_modules/appbuilder)

    I then added ~/node_modules/appbuilder/bin to the PATH and renamed ~/node_modules/appbuilder/bin/appbuilder.js to appbuilder.

    I can run appbuilder now without issue.
Back to Top