I open a clearer question.
How is it possible on precompile script in a .NET project, to make VS2015 build the Angular2-cli project with angular-cli tools (ng
) installed globally via npm.
Steps:
- npm install -g angular-cli
- In our .NET project under VS2015, on F5 (build) we need ng build
to be called.
We tried:
"precompile": [ "npm install -g angular-cli", "npm install", "ng build --prod" ],
But I encounter errors on VS2015 console. Full logs: http://pastebin.com/RMiU6eMe
VS2015 doesn't seem to manage to use globally installed ng
command.
I tried in our script to call directly the ng
tool installed locally as declared in our package.json via npm install:
"precompile": [ "npm install", "node_modules/angular-cli/bin/ng build --prod" ],
But VS2015 answers as below:
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\DotNet\Microsoft.DotNet.Common.Targets(262,5): error : The specified executable is not a valid application for this OS platform.
I don't want to have to run separately from command line ng build
(which works by the way...) BEFORE being able to build on VS2015.
Add a command
"build": "ng build",
in yourpackage.json
, then, instead of trying to run the ng build, just run thenpm build
.You can also add this to your package.json to bundling it each time you build your solution.