Skip to content
This repository was archived by the owner on Apr 8, 2020. It is now read-only.

Commit 9a59bcc

Browse files
If Node isn't installed, give clear instructions rather than random build errors
1 parent bf6d222 commit 9a59bcc

File tree

6 files changed

+36
-0
lines changed

6 files changed

+36
-0
lines changed

templates/AngularSpa/AngularSpa.csproj

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@
3030

3131
<!--/-:cnd:noEmit -->
3232
<Target Name="DebugRunWebpack" BeforeTargets="Build" Condition=" '$(Configuration)' == 'Debug' And !Exists('wwwroot\dist') ">
33+
<!-- Ensure Node.js is installed -->
34+
<Exec Command="node --version" ContinueOnError="true">
35+
<Output TaskParameter="ExitCode" PropertyName="ErrorCode" />
36+
</Exec>
37+
<Error Condition="'$(ErrorCode)' != '0'" Text="Node.js is required to build and run this project. To continue, please install Node.js from https://nodejs.org/, and then restart your command prompt or IDE." />
38+
3339
<!-- In development, the dist files won't exist on the first run or when cloning to
3440
a different machine, so rebuild them if not already present. -->
3541
<Message Importance="high" Text="Performing first-run Webpack build..." />

templates/AureliaSpa/AureliaSpa.csproj

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@
2525

2626
<!--/-:cnd:noEmit -->
2727
<Target Name="DebugRunWebpack" BeforeTargets="Build" Condition=" '$(Configuration)' == 'Debug' And !Exists('wwwroot\dist') ">
28+
<!-- Ensure Node.js is installed -->
29+
<Exec Command="node --version" ContinueOnError="true">
30+
<Output TaskParameter="ExitCode" PropertyName="ErrorCode" />
31+
</Exec>
32+
<Error Condition="'$(ErrorCode)' != '0'" Text="Node.js is required to build and run this project. To continue, please install Node.js from https://nodejs.org/, and then restart your command prompt or IDE." />
33+
2834
<!-- In development, the dist files won't exist on the first run or when cloning to
2935
a different machine, so rebuild them if not already present. -->
3036
<Message Importance="high" Text="Performing first-run Webpack build..." />

templates/KnockoutSpa/KnockoutSpa.csproj

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@
2525

2626
<!--/-:cnd:noEmit -->
2727
<Target Name="DebugRunWebpack" BeforeTargets="Build" Condition=" '$(Configuration)' == 'Debug' And !Exists('wwwroot\dist') ">
28+
<!-- Ensure Node.js is installed -->
29+
<Exec Command="node --version" ContinueOnError="true">
30+
<Output TaskParameter="ExitCode" PropertyName="ErrorCode" />
31+
</Exec>
32+
<Error Condition="'$(ErrorCode)' != '0'" Text="Node.js is required to build and run this project. To continue, please install Node.js from https://nodejs.org/, and then restart your command prompt or IDE." />
33+
2834
<!-- In development, the dist files won't exist on the first run or when cloning to
2935
a different machine, so rebuild them if not already present. -->
3036
<Message Importance="high" Text="Performing first-run Webpack build..." />

templates/ReactReduxSpa/ReactReduxSpa.csproj

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@
3030

3131
<!--/-:cnd:noEmit -->
3232
<Target Name="DebugRunWebpack" BeforeTargets="Build" Condition=" '$(Configuration)' == 'Debug' And !Exists('wwwroot\dist') ">
33+
<!-- Ensure Node.js is installed -->
34+
<Exec Command="node --version" ContinueOnError="true">
35+
<Output TaskParameter="ExitCode" PropertyName="ErrorCode" />
36+
</Exec>
37+
<Error Condition="'$(ErrorCode)' != '0'" Text="Node.js is required to build and run this project. To continue, please install Node.js from https://nodejs.org/, and then restart your command prompt or IDE." />
38+
3339
<!-- In development, the dist files won't exist on the first run or when cloning to
3440
a different machine, so rebuild them if not already present. -->
3541
<Message Importance="high" Text="Performing first-run Webpack build..." />

templates/ReactSpa/ReactSpa.csproj

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@
2525

2626
<!--/-:cnd:noEmit -->
2727
<Target Name="DebugRunWebpack" BeforeTargets="Build" Condition=" '$(Configuration)' == 'Debug' And !Exists('wwwroot\dist') ">
28+
<!-- Ensure Node.js is installed -->
29+
<Exec Command="node --version" ContinueOnError="true">
30+
<Output TaskParameter="ExitCode" PropertyName="ErrorCode" />
31+
</Exec>
32+
<Error Condition="'$(ErrorCode)' != '0'" Text="Node.js is required to build and run this project. To continue, please install Node.js from https://nodejs.org/, and then restart your command prompt or IDE." />
33+
2834
<!-- In development, the dist files won't exist on the first run or when cloning to
2935
a different machine, so rebuild them if not already present. -->
3036
<Message Importance="high" Text="Performing first-run Webpack build..." />

templates/VueSpa/VueSpa.csproj

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@
2525

2626
<!--/-:cnd:noEmit -->
2727
<Target Name="DebugRunWebpack" BeforeTargets="Build" Condition=" '$(Configuration)' == 'Debug' And !Exists('wwwroot\dist') ">
28+
<!-- Ensure Node.js is installed -->
29+
<Exec Command="node --version" ContinueOnError="true">
30+
<Output TaskParameter="ExitCode" PropertyName="ErrorCode" />
31+
</Exec>
32+
<Error Condition="'$(ErrorCode)' != '0'" Text="Node.js is required to build and run this project. To continue, please install Node.js from https://nodejs.org/, and then restart your command prompt or IDE." />
33+
2834
<!-- In development, the dist files won't exist on the first run or when cloning to
2935
a different machine, so rebuild them if not already present. -->
3036
<Message Importance="high" Text="Performing first-run Webpack build..." />

0 commit comments

Comments
 (0)