mirror of
https://github.com/kuhyx/WUT_Computer_Science.git
synced 2026-11-11 20:33:55 +01:00
feat: added nx installation to powershell script
This commit is contained in:
parent
7d555057e2
commit
94808c3245
@ -1,2 +1,37 @@
|
|||||||
# PowerShell Script
|
# PowerShell Script
|
||||||
|
# Step 1: Check if Node.js is installed
|
||||||
|
if (-Not (Get-Command node -ErrorAction SilentlyContinue)) {
|
||||||
|
# Step 2: Download and install Node.js
|
||||||
|
Write-Output "Node.js is not installed. Installing Node.js..."
|
||||||
|
|
||||||
|
# Define the Node.js version to install
|
||||||
|
$nodeVersion = "node-v16.14.2-win-x64"
|
||||||
|
$url = "https://nodejs.org/dist/v16.14.2/$nodeVersion.zip"
|
||||||
|
|
||||||
|
# Specify path to save the Node.js ZIP
|
||||||
|
$output = "$env:USERPROFILE\Downloads\$nodeVersion.zip"
|
||||||
|
|
||||||
|
# Download Node.js
|
||||||
|
Invoke-WebRequest -Uri $url -OutFile $output
|
||||||
|
|
||||||
|
# Extract Node.js
|
||||||
|
$nodeExtractPath = "$env:USERPROFILE\NodeJS"
|
||||||
|
Expand-Archive -LiteralPath $output -DestinationPath $nodeExtractPath
|
||||||
|
|
||||||
|
# Add Node.js to PATH
|
||||||
|
$env:Path += ";$nodeExtractPath\$nodeVersion"
|
||||||
|
[Environment]::SetEnvironmentVariable("Path", $env:Path, [EnvironmentVariableTarget]::Machine)
|
||||||
|
|
||||||
|
Write-Output "Node.js installed successfully."
|
||||||
|
} else {
|
||||||
|
Write-Output "Node.js is already installed."
|
||||||
|
}
|
||||||
|
|
||||||
|
# Step 3: Install Nx CLI globally using npm
|
||||||
|
Write-Output "Installing Nx CLI..."
|
||||||
|
npm install -g nx
|
||||||
|
|
||||||
|
Write-Output "Nx installation completed successfully. You can now start using Nx!"
|
||||||
|
|
||||||
|
|
||||||
nx run-many --target=serve --projects=frontend,backend --parallel
|
nx run-many --target=serve --projects=frontend,backend --parallel
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user