Archived Support Site

This support site is archived. You can view the old support discussions but you cannot post new discussions.

resolve bower dependencies

William's Avatar

William

17 May, 2016 12:18 PM

Hi,

When I am trying to resolve my bower components I am receiving the error: "fatal: Unable to read current working directory: No error".
Can you assist ?

See the build log https://appharbor.com/applications/skeletonmvc/builds/1742490 for the error.

  1. Support Staff 1 Posted by rune on 24 May, 2016 05:16 AM

    rune's Avatar

    Hi there,

    Apologies for the slow response. This one took some digging, but it turns out that this error is returned from Git, which is being invoked by npm/bower. This won't cause issues locally as you're likely running and building the project from a git repository and have access to all folders on your system.

    When your app is built on AppHarbor we'll just fetch a tarball from GitHub containing the source files to build. This means that the current working directory for your build.ps1 script is not a git repository. Git will then recursively inspect folders up until the root path, but doesn't have permissions to do so (as the user account processing your builds has restricted filesystem access).

    We might be able to mitigate this issue on our end at some point, but for now you can handle it pretty easily: Just initialize a git repository in your build.ps1 script before running any of the bower/npm commands. This way Git won't traverse the whole directory tree and can continue processing as usual. So just add this somewhere in the beginning of the build.ps1 script:

    git init
    

    Also, please note that builds on AppHarbor use an output directory that's different from the input directory. Currently your script operates on the input folder, but it doesn't seem to copy any files to the web project output directory. Depending on how you use bower you might be able to just copy the files after the build has completed. For instance, you could add something like this to the same post build event where you copy the roslyn compiler:

    if not exist "$(WebProjectOutputDir)\bower_components" md "$(WebProjectOutputDir)\bower_components"
    start /MIN xcopy /s /y /R "$(MSBuildProjectDirectory)\bower_components\*.*" "$(WebProjectOutputDir)\bower_components"
    

    I hope this helps. Let me know how it works out!

    Best,
    Rune

  2. 2 Posted by William McNulty on 24 May, 2016 06:56 PM

    William McNulty's Avatar

    Hi Rune,
    Just wanted to thank you for taking the time to respond to my query, as well as providing a fix.I really appreciate the AppHarbor support and will definitely be using it for future projects.
    Cheers,Will

  3. 3 Posted by William McNulty on 24 May, 2016 09:08 PM

    William McNulty's Avatar

    Also, feel free to make this ticket public as I know a few others faced similar issues (see https://support.appharbor.com/discussions/problems/79865-git-isnt-currently-a-part-of-the-build-server-setup).
    Thanks again,Will

    From: [email blocked]
    To: [email blocked]
    Subject: RE: resolve bower dependencies [Support #82415]
    Date: Tue, 24 May 2016 19:56:03 +0100

    Hi Rune,
    Just wanted to thank you for taking the time to respond to my query, as well as providing a fix.I really appreciate the AppHarbor support and will definitely be using it for future projects.
    Cheers,Will

  4. Support Staff 4 Posted by rune on 25 May, 2016 03:57 AM

    rune's Avatar

    Hi Will,

    Good to hear this solution worked out for you! I'll make it public so others can benefit from it as well. Let me know if there's anything else I can help with!

    Thanks,
    Rune

  5. rune closed this discussion on 25 May, 2016 03:57 AM.

Discussions are closed to public comments.
If you need help with AppHarbor please start a new discussion.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac