Problems installing angular 2 packages using npm in VS2015 Update 2 - angularjs

I am attempting to use the latest angular2 quickstart files with a new empty ASP.NET Core 1.0 Web Application.
VS2015 Update 2 - w/ Core 1.0 RC2 installed
Steps to reproduce:
Create a new project using ASP.NET Core Web Application (.NET Core) - Empty Template
Add the 4 angular quick-start files to your root directory, NOT Hitting save on package.json until the other 3 are added and saved.
Finally, hit save on package.json and npm will start installing all of the packages. However, at the end I see Dependencies - not installed, npm - not installed. I can't figure out what could be causing this. It has to be a VS2015 / npm bug because if I use VSCode and npm from command line everything installs perfectly with this package.json file.

This is a bug in the Web Tools for ASP.NET Core RC2, which was discovered after RC2 was shipped. It's only that the "- not installed" UI is showing up incorrectly. The packages are successfully installed.
I'm not sure what is causing it yet, but we are aware of the issue and will try to fix this in a future release of the Web Tools.

Related

node_modules/webpack/bin/webpack.js error occur when build project asp.net core 2.0 with react.js

I want to create project in asp.net core 2.0 with react.js.
I have Visual Studio Community 2017 (2) version 15.9.17 with Microsoft .net framework v4.8.03761.
When I create project, using .Net Core > Asp.NET Core Web Application & select Asp.Net Core 2.0 as targeted version with React.js as showing in link https://www.screencast.com/t/SRVV7vOmkz
when I build project this error is showing
Error MSB3073 The command "node node_modules/webpack/bin/webpack.js
--config webpack.config.vendor.js" exited with code 1.
I could get a similar error info if I build a new project without running npm i when using React +ASP.NET Core 2.0.
If that's the case, please make sure
you have installed the node.js
run cmd/powershell (might require RunAs Administrator )
and cd into the project folder (the folder that contains the *.csproj)
run npm i to install the dependencies (make sure there's no error info when you run npm i. If you cannot make it, try npm i --force):
> cd /path/to/the/folder/that/contains/the/*.proj/file
> npm i
Finally, it should work fine now.
As a side note, ASP.NET Core 2.0 has reached its EOL. Please consider updating it to 2.1 (LTS).

AspNetBoilerplate REACT template - error after npm start

Today I downloaded the ABP Asp.Net Core REACT SPA template. After downloading, I ran npm install and then npm start. These two steps worked, no issues.
Once the REACT app has started, the browser opens up and all I get is a blank page. Then after a few seconds the below error dialog box comes up.
When I look at the chrome console, I find the errors shown below.
I'm new to REACT and very much still learning it. So I could use some help in tracking this error down.
Please note I did run the migrator project and got the DB setup on my PC and updated the connection strings to ensure connectivity for the .NET code.
Follow steps below to check whether you miss any step:
VS 2019 Open abp project
Change YourProjectName.Web.Host -> appsettings.json -> ConnectionStrings.Default
From VS 2019 PMC, set YourProjectName.EntityFrameworkCore as Default Project
Run update-database which will create the database
Set YourProjectName.Web.Host as Start Project, and run YourProjectName.Web.Host
For expected result, you will get http://localhost:21021/swagger/index.html
CD reactjs folder and run npm install and npm start
http://localhost:3000/user/login will show up.

node_modules breaks build in Visual Studio

Working to add Angular (v4) to an existing ASP.NET MVC 4 application. One of the projects it has includes Selenium Web Driver which has a web.config file included.
node_modules\selenium-webdriver\lib\test\data\web.config
This folder is NOT included in the project but is in my web application folder
myapplication\node_modules
myapplication\Controllers
myapplication\Views
myapplication\web.config
etc...
The web.config in the selenium-webdriver folder causes the build to break with the following error:
It is an error to use a section registered as
allowDefinition='MachineToApplication' beyond application level. This
error can be caused by a virtual directory not being configured as an
application in IIS.
Pretty common error and easily fixed when it is your own mistake, but since this is a library I'm using I don't have control over the file. So my question is a bit leveled based on my research:
Can I make the "test" folder of selenium-webdriver go somewhere else?
Should my node_modules folder not be at the root of my web application?
In general.. how do I fix this?
install the rimraf package
npm install rimraf
then in package.json use rimraf command
'script': {
'postinstall': 'rimraf node_modules/**/web.config'
}
Please note that first time you will have to delete it manually, as the package is already installed and postinstall command will not run.
But for all your future installs + for your teammates, it will be taken care of automatically as postinstall command runs after every npm install
Please do read more about npm pre & post hooks
Its more of a work-around, but my making your node_modules folder hidden it won't show up in your solution explorer and Visual Studio will run your project as normal. As far as I could see, this doesn't affect running your web application.

How to install angularjs correctly on an asp .net core project?

I tried to install the latest angularjs (1.5.5) via bower. It was taking already an hour so I tried installing an earlier version (1.5.0). It actually worked, but bower also tried to install 1.6.2. Now its taking forever for the build to finish. Is there something that I have missed along the installation?
installation via bower installation

Is there an official nuget package for Angular 2?

I'm currently working in a work environment where I do not have access to npm / node. The npm download location is actually blocked so I can't get any packages.
I want to build an Angular 2 site. As I can't access npm, I want to use Nuget to get the files. Although I can see the Angular 1 packages, I cannot seem to see any Angular 2 packages. Is there one for Nuget?
Also, is populating the node_module folder and compiling the Typescript the only thing that npm does for Angular? If I can just get a copy of the node_module folder (from outside work) and get TypeScript working in my solution, can I basically bypass the need for npm?
In short; No.
You can see a list of all available NuGet package versions here, with the most recent being 1.5.3.
Even performing a generic search shows most recent versions as 1.5.3.
Sometimes they'll have beta versions of packages available that you can install with a command similar to: Install-Package EntityFramework -Version 6.1.3-beta1 -Pre, but it doesn't appear as if they have created any pre-release packages.
So, as #Michal Dymel mentioned, you could get it from a CDN or some other location.

Resources