Not able to install bootstrap 4 (beta) nuget package to .Net MVC (.Net version 4.6.2)

前端 未结 9 1872
Happy的楠姐
Happy的楠姐 2021-02-19 07:58

I am not able to install bootstrap 4(beta) to my MVC project. To be precise popper.js nuget dependency is failing to install. Please let me know any possible way to do it(bower

9条回答
  •  猫巷女王i
    2021-02-19 08:30

    I was finally able to get Bootstrap 4-Beta working by doing the following:

    1.) Install the popper.js NuGet Package V1.12.3

    2.) Install Bootstrap4-beta NuGet Package

    3.) Update your BundleConfig.cs to include the following: Note the popper.js path

    bundles.Add(new ScriptBundle("~/Scrpts/Bootstrap").Include(
                                 /*** Make sure popper.js is pointing to umd ***/
                                 "~/Scripts/umd/popper.js", 
                                 "~/Scripts/bootstrap.js",
                                 ));
    
    bundles.Add(new StyleBundle("~/CSS/Bootstrap").Include(
                                "~/Content/bootstrap.css"));
    

    For some reason if you try to use the popper.js in the root of the \Scripts folder you will receive the error:

    SyntaxError: export declarations may only appear at top level of a module
    

    but the version in the /Scripts/umd seems to work.

提交回复
热议问题