1

I created a .NET Core Application in Visual Studio 2015, and this project includes Bower as a Package Manager. Here is the Manage Bower Packages Interface:

enter image description here

When using the Manage Bower Packages Interface I have tried to install or update anything, and I am consistently getting a permission error like this:

ECMDERR Failed to execute "git clone https://github.com/jquery/jquery-dist.git -b 1.11.3 --progress . --depth 1", exit code of #128 fatal: Could not switch to '.': Permission denied

1st Modification I have tried to change the json bower configuration file .bowerrc from this:

{
    "directory": "www/lib"
}

to look like this:

{
    "directory": "www/lib",
    "allow_root": true
}

2nd Modification I Configured Git to use http instead of git:// with Git Bash

git config --global url."http://".insteadOf git://

Also Configured VS 2015 to use the new installed Git over VS Git

Right clicked on Bower folder under Dependencies, then selected Configure external tools; 
Unchecked "$(DevEnvDir)\Extensions\Microsoft\Web Tools\External\git"
Added a new node with "C:\Program Files (x86)\Git\bin"

3rd Modification to Edit the file bower.cmd Previous Solution indicated bower.cmd was located here:

C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Microsoft\Web Tools\External 

This Path doesn't exist in my setup, however it exists here where I modified bower.cmd:

C:\Program Files (x86)\Microsoft Visual Studio 14.0\Web\External

I modified bower.cmd similar to Previous Solution:

set PATH=C:\Program Files (x86)\Git\bin\;%PATH%
@"%~dp0\node\node" "%~dp0\bower\node_modules\bower\bin\bower" %*

2 Answers 2

0

sudo chown -R $USER:$GROUP ~/.npm is a Linux command. It is not helpful if you are developping on Windows.

Try to add bower.json file to your project in Visual Studio and write the code:

{
  "dependencies": {
    "jquery": "3.1.1"
  }
}

Save the file. I have never used Manage Bower Packages Interface but editing bower.json always worked. It should create the files under wwwroot/lib/jquery/.

5
  • I already have bower.json and there I had also tried to modify the jquery from 2.2.0 to 1.11.3 but I get the same error
    – Paul
    Feb 23, 2017 at 15:01
  • So it is a permission problem. Open a command prompt in a random folder of your Documents and run the command git clone https://github.com/jquery/jquery-dist.git -b 1.11.3 --progress . --depth 1. Do you get the same permission error? If you get an error like 'git' is not recognized, retype the command but start it with the full path to your git executable like C:\Programs\Git\git.exe clone ... Feb 23, 2017 at 16:27
  • Within Visual Studio 2015/Projects Folder I ran the command without --depth 1,, this created jquery-dist folder within that same /Projects Folder,, however I'm still receiving same error from within VS from other project within /Projects
    – Paul
    Feb 23, 2017 at 19:47
  • I remember now that, in Visual Studio 2015, I am mainly using tools (such as Git, NPM) that I installed as a standalone, and ask Visual Studio to choose them in priority. Follow the step 1 and 3 in the answer here stackoverflow.com/questions/28725727/… If it works for you, I will edit my answer to point this link. There is some chances it can fix your problem. Feb 23, 2017 at 20:12
  • I went with the first solution,, Item 3 was slightly different in my VS whereby I unchecked $(VSINSTALLDIR)\Web\External\git and added C:\Program Files\Git\bin but I'm still getting that error
    – Paul
    Feb 23, 2017 at 21:24
0

I moved $(PATH) above $(VSINSTALLDIR)\Web\External

Tools, Options, Projects and Solutions, External Web Tools

enter image description here

I modified the installed Jquery to previous version 1.11.3 Bower Console Manager indicates that 2.2.3 is installed, however, bower.json indicates 1.11.3 is installed. Also I tried installing boostrap 3.3.7 which does not provide option, it only has option for bootstrap 3.3.6. I believe this problem is part of this issue

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.