Skip to content

Commit 460e67e

Browse files
committed
Merge pull request #1432 from NativeScript/totev/fix-npm-setup
Install node.js 4.2.5 - most stable at the moment
2 parents 1931b80 + 5ac0427 commit 460e67e

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

setup/empty

Whitespace-only changes.

setup/empty.tar.gz

-129 Bytes
Binary file not shown.

setup/native-script.ps1

+13-4
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ write-host -BackgroundColor Black -ForegroundColor Yellow "Installing Google Chr
1111
cinst googlechrome
1212

1313
write-host -BackgroundColor Black -ForegroundColor Yellow "Installing node.js"
14-
cinst nodejs.install -version 5.1.0
14+
cinst nodejs.install -version 4.2.5
1515

1616
write-host -BackgroundColor Black -ForegroundColor Yellow "Installing Java Development Kit"
1717
cinst jdk8
@@ -20,11 +20,14 @@ write-host -BackgroundColor Black -ForegroundColor Yellow "Installing Android SD
2020
cinst android-sdk
2121

2222
# setup android sdk
23-
echo yes | cmd /c $env:localappdata\Android\android-sdk\tools\android update sdk --filter "tools,platform-tools,android-23,build-tools-23.0.2,extra-android-m2repository" --all --no-ui
23+
echo yes | cmd /c "$env:localappdata\Android\android-sdk\tools\android" update sdk --filter "tools,platform-tools,android-23" --all --no-ui
24+
echo yes | cmd /c "$env:localappdata\Android\android-sdk\tools\android" update sdk --filter "build-tools-23.0.1,extra-android-m2repository" --all --no-ui
2425

2526
# setup environment
2627

27-
if (!$env:ANDROID_HOME) { [Environment]::SetEnvironmentVariable("ANDROID_HOME", "$env:localappdata\Android\android-sdk", "User") }
28+
if (!$env:ANDROID_HOME) {
29+
[Environment]::SetEnvironmentVariable("ANDROID_HOME", "$env:localappdata\Android\android-sdk", "User")
30+
}
2831

2932
if (!$env:JAVA_HOME) {
3033
$curVer = (Get-ItemProperty "HKLM:\SOFTWARE\JavaSoft\Java Development Kit").CurrentVersion
@@ -34,6 +37,12 @@ if (!$env:JAVA_HOME) {
3437

3538
# install NativeScript CLI
3639
write-host -BackgroundColor Black -ForegroundColor Yellow "Installing NativeScript CLI"
37-
npm install -g nativescript
40+
41+
$oldPathUser = [Environment]::GetEnvironmentVariable("PATH", "User")
42+
$pathMachine = [Environment]::GetEnvironmentVariable("PATH", "Machine")
43+
$myPath = [Environment]::GetEnvironmentVariable("PATH")
44+
[Environment]::SetEnvironmentVariable("PATH", "$myPath;$oldPathUser;$pathMachine;$env:ProgramFiles\nodejs")
45+
46+
cmd /c "npm" install -g nativescript
3847

3948
write-host -BackgroundColor Black -ForegroundColor Yellow "This script has modified your environment. You need to log off and log back on for the changes to take effect."

0 commit comments

Comments
 (0)