bootstrap: Can NOT install bower package from Visual Studio / Core 2

Hello, I’m a newbie… I was trying to install Bootstrap bower package on Visual Studio 2017 but I get an ugly error as follow:

bower bootstrap#v4.0.0-beta.2 EMALFORMED Failed to read C:\Users\ADMINI~1\AppData\Local\Temp\1\WIN-DPN1LB7550E-Administrator\bower\ca4c50b905dc21ea17a10549a6f5944f-5952-MJCiLU\bower.json Additional error details: Unexpected token @

This is what I did to test:

  1. I tried to install other packages than bootstrap, for example JQuery and it did complete with no problems.

  2. I did start a complete full empty app, just in case something was generating the error and tried to install the package, same result.

I tried to check what was inside bower.json file but it seems something the package create temporarily in the route above and before I can do anything, it display a msg with the error on VS and delete all the files, including bower.json

I have VS community edition and inside I have a file called bower.json also which contains: { "name": "asp.net", "private": true, "dependencies": { } } and other file called .bowerrc which contains: { "directory": "wwwroot/lib" } I can just point to the external CSS and JS but I would like to understand why I cant install this bower package into my project in VS

PLEASE and THANK YOU for your help. 😃

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 37 (10 by maintainers)

Most upvoted comments

I don’t think it’s the responsibility of the Bootstrap project to teach people how to use NPM. There’s plenty of documentation online if you look for it.

If you’re having trouble with the Visual Studio NPM integration, I would submit a ticket to them.

Or maybe now is a good time to start learning the command line, so you are not bound to an IDE and the way they do things.

better yet, let’s get rid of the package managers, and just copy-paste the code into our projects.

@browner12 That was rude! So you think to display a generic msg like “use a better method instead” explains much of what’s going on? I don’t want to work with a developer like you… it’s true is not responsibility of bootstrap to explain what NPM is but, I do consider a better explanation or a link to a discussion board would be fine… sorry we are not smart as you are

calm down. we’ve explained to you that Bower is basically deprecated. We’ve explained that NPM is one of the current best practices for package management. We also told you there’s plenty of documentation available, more info than your going to get from a Github issue comment. Also, Github issues are for bug reports and feature suggestions, not for general help on how to use things. We have forums and Slack and more for that. I’m trying to direct you to the proper channel.

By your own admission, you are a relatively green programmer, so it’s very common to use the IDE tools. I’m assuming you want to grow as a developer, so myself (as an experienced programmer) am suggesting to you that you learn more about the command line, which will help you be a better programmer.

Part of becoming a better programmer is also learning how to search for things (documentation, examples, etc). Asking for someone to just link you the answer is not going to help you get better. Give Google a shot, and read some of the excellent NPM tutorials that are available.

Dear @bardiharborow thanks for your attention to this situation. According to what you said in your last message, this is what I think:

  1. I don’t know the reasons for you to move away from Bower, and I will not question that, the problem I see is that, everybody is teaching to install this package using Bower as suggested on Visual Studio, not NPM, in fact a person like me does not understand exactly what you mean by NPM. If you are moving, probably is the best way to go BUT, please provide a tutorial or any resource that shows how to install or use NPM in Visual Studio 2017, because at this point is frustrating to get a generic error saying “Token expected” and a weird message saying “Bower not supported, use a better way”…
  2. The reason to mention Nugget is because from Visual Studio you can install packages using Nugget or Bower, in Core 2, Nugget is used mainly for core features and C# libraries. When you try to install Bootstrap from Nugget a msg appear saying “not supported, please USE Bower instead”, as Bower in intended for front-end packages… the problem is Bower is not working with Bootstrap.

Thank you for your Help and please let me know, thank you.

BUT how can you do that this way? it creates great problems for people like me… I can’t install the package using Nugget because it says is incompatible, leaving the only option to Bower… and we can’t install it because you decided not to support it… is not that I want to use Bower, but that is what we have in Visual Studio… at least you should notify MS about this…

From what I did read in your forums, a person (which I think is the admin) says: “we are going to remove Bower, how many says yes?” and other people responded “it is not needed anyway”, etc etc etc… and then remove Bower and damage the integration with VS… I dont think this is the proper way to do this, I have 2 hours trying to discover what the hell is happening and found your answer just saying “is dead, so we removed it”… whaaaaaat?

default How about that? Installing via NuGet is also not supported. So the NPM remains the only option.

The problem is that NPM is not supporting anything other then putting all package contents to node_modules folder.

Sad. I’m using ASP.NET Core 2.0. This requires me to put js/css files in wwwroot folder. An option would be to use npm with Grunt or Gulp.

BUT. What if, for the development I need unminified files? Should find the way to configure grunt/gulp to put not minified files to wwwroot in development, and minified in release.

This is in deed a configuration hell.

The frustration comes from the fact, that latest version of bootstrap is less accessible and harder to use, than it used to be.

Yes, you can tell, that this is a problem for Visual Studio team to solve, but don’t you think that you drop support of bower too early? Wouldn’t it be better to wait untill bower will get fully retired and replaced by other means in Visual Studio?

i hope my sarcasm came across on that last post. should have used <sarcasm> tags.

we are far better off now with package managers than we were before.

tbh, that isn’t far from the truth, @browner12 . Instead of the hell of managing the libraries/versions themselves, now we have package manager configuration hell. It’s just a different pain point… but it’s still pain.

As Bower is deprecated and we want to use Lerna to ship multi package in one repository (and bower cannot handle that case) we chose to remove Bower when our v4 is still in a beta state.

…psst! While Bower is maintained, we recommend yarn and webpack for new front-end projects! (see: https://github.com/bower/bower)