This is a migrated thread and some comments may be shown as answers.

appbuilder, sudo and ubuntu 14.04

2 Answers 56 Views
Command-Line Interface
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Taylor
Top achievements
Rank 1
Taylor asked on 09 Oct 2014, 02:49 AM
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 Answers, 1 is accepted

Sort by
0
Todor
Telerik team
answered on 09 Oct 2014, 12:06 PM
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.

Regards,
Todor
Telerik
 

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

 
0
Taylor
Top achievements
Rank 1
answered on 09 Oct 2014, 03:24 PM
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.
Tags
Command-Line Interface
Asked by
Taylor
Top achievements
Rank 1
Answers by
Todor
Telerik team
Taylor
Top achievements
Rank 1
Share this question
or