简体   繁体   中英

Why won't the jquery-validation bower package build for me in VS2015?

When I try to install the jquery-validation bower package in VS2015, I am not getting a dist folder under bower_components/jquery-validation while my co-workers are. I'm guessing that I have something configured wrong on my box, but what can it be? FYI, I have VS2015 Update 3, .NET Core 1.0.0 - SDK Preview 2, and .NET Core 1.0.0 - VS 2015 Tooling Preview 2.

Here's an easy way for me to produce the problem on my computer (although it works for others):

  1. Create a new ASP.NET Core Web Application (.NET Core) project, using the Empty template
  2. Right click on the project and click on Manage Bower Packages
  3. Click browse and search for jquery-validation
  4. Click Install
  5. Look under the bower_components/jquery-validation folder and there should be a dist folder (but it is missing for me)

Another clue is that I believe that grunt is involved in the creation of the dist folder. The jquery-validation folder has a gruntfile.js file. It seems that perhaps my co-workers have grunt running automatically when they download a bower package, but I'm not sure how to configure that.

I solved exactly the same problem in the following way:

  1. In Visual Studio \\ Tools \\ Options \\ Projects and Solutions \\ External Web Tools replaced $(VSINSTALLDIR)\\Web\\External\\git by C:\\Program Files\\Git\\bin (path to git.exe from Git for Windows installation).
  2. Cleared bower cache directory: %UserProfile%\\AppData\\Local\\bower\\cache .

check please 'wwwroot/lib'. I think bower should save there packages.

I answered a similar question recently for same issue: https://stackoverflow.com/a/39185621/6137718 . This is also solvable by having a grunt-task at the project-level that automatically runs npm install on all bower packages - however, since I'm following a simple tutorial, I did not investigate this further. Below is the answer I submitted for getting the dist folder populated:


I had a similar issue and was able to fix it by installing grunt globally then running npm install in the jquery-validation folder:

  1. Open node js command prompt and run npm install -g grunt
  2. In any command prompt (I used developer command prompt from VS) navigate to jquery-validation folder and run npm install

Afterwards, the jquery-validation\\dist folder should show up with the jquery.validate.js file.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM