Converted global npm dependencies to use npx.

This commit is contained in:
Jim Buck
2019-10-22 23:59:47 -04:00
parent f64b780a27
commit b6fb1cb0bf
6 changed files with 4 additions and 17 deletions

View File

@@ -4,6 +4,5 @@ dist: xenial
dotnet: 3.0
before_script:
- export PATH="$PATH:/home/travis/.dotnet/tools"
- npm install electron-packager --global
script:
- ./buildAll.sh

View File

@@ -72,9 +72,8 @@ namespace ElectronNET.CLI.Commands
ProcessHelper.CmdExecute("npm install", targetFilePath);
// run typescript compiler
string tscPath = Path.Combine(targetFilePath, "node_modules", ".bin");
// ToDo: Not sure if this runs under linux/macos
ProcessHelper.CmdExecute(@"tsc -p ../../", tscPath);
ProcessHelper.CmdExecute(@"npx tsc -p ../../", targetFilePath);
// search .csproj
Console.WriteLine($"Search your .csproj to add configure CopyToPublishDirectory to 'Never'");

View File

@@ -118,7 +118,7 @@ namespace ElectronNET.CLI.Commands
ProcessHelper.CmdExecute("npm install", hosthookDir);
// ToDo: Not sure if this runs under linux/macos
ProcessHelper.CmdExecute(@"tsc -p . --sourceMap false", hosthookDir);
ProcessHelper.CmdExecute(@"npx tsc -p . --sourceMap false", hosthookDir);
}
Console.WriteLine("Build Electron Desktop Application...");
@@ -153,7 +153,7 @@ namespace ElectronNET.CLI.Commands
ProcessHelper.CmdExecute($"node build-helper.js", tempPath);
Console.WriteLine($"Package Electron App for Platform {platformInfo.ElectronPackerPlatform}...");
ProcessHelper.CmdExecute($"electron-builder . --config=./bin/electron-builder.json --{platformInfo.ElectronPackerPlatform} --{electronArch} -c.electronVersion=5.0.8 {electronParams}", tempPath);
ProcessHelper.CmdExecute($"npx electron-builder . --config=./bin/electron-builder.json --{platformInfo.ElectronPackerPlatform} --{electronArch} -c.electronVersion=5.0.8 {electronParams}", tempPath);
Console.WriteLine("... done");

View File

@@ -79,9 +79,8 @@ namespace ElectronNET.CLI.Commands
Console.WriteLine("Start npm install for typescript & hosthooks...");
ProcessHelper.CmdExecute("npm install", hosthookDir);
string tscPath = Path.Combine(tempPath, "node_modules", ".bin");
// ToDo: Not sure if this runs under linux/macos
ProcessHelper.CmdExecute(@"tsc -p ../../ElectronHostHook", tscPath);
ProcessHelper.CmdExecute(@"npx tsc -p ../../ElectronHostHook", tempPath);
}
string path = Path.Combine(tempPath, "node_modules", ".bin");

View File

@@ -31,8 +31,6 @@ The current Electron.NET CLI builds Windows/macOS/Linux binaries. Our API uses .
Also you should have installed:
* npm
* npm install -g typescript
* npm install -g electron-builder
# Community
@@ -104,12 +102,6 @@ To start the application make sure you have installed the "[ElectronNET.CLI](htt
dotnet tool install ElectronNET.CLI -g
```
* Make sure you have __node.js v8.6.0__ and on __macOS/Linux__ the electron-builder installed!
```
sudo npm install electron-builder --global
```
At the first time, you need an Electron.NET project initialization. Type the following command in your ASP.NET Core folder:
```

View File

@@ -1,8 +1,6 @@
version: 1.0.{build}
image: Visual Studio 2019
build_script:
- cmd: npm install typescript --global
- cmd: npm install electron-builder --global
- cmd: buildAll.cmd
pull_requests:
do_not_increment_build_number: true