Skip to content

Install node.js 4.2.5 - most stable at the moment #1432

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 28, 2016

Conversation

teobugslayer
Copy link
Contributor

Fix Android SDK installation
Fix nativescript cli installation

See #1429

Fix Android SDK installation
Fix nativescript cli installation

See #1429
$oldPathUser = [Environment]::GetEnvironmentVariable("PATH", "User")
$pathMachine = [Environment]::GetEnvironmentVariable("PATH", "Machine")
$myPath = [Environment]::GetEnvironmentVariable("PATH")
[Environment]::SetEnvironmentVariable("PATH", "$myPath;$oldPathUser;$pathMachine;$env:ProgramFiles\nodejs")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've not tested it, but according to this forum the PATH will not be "set" in the current Shell until you restart:

To set it PERMANENTLY you use SetEnvironmentVariable, but to have it
take effect NOW you need to use the Env: drive.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to MSDN the value will not be set until PowerShell is restarted:

Or at least it didn’t show up until we restarted PowerShell. (Or started up a new instance of PowerShell.)

Maybe we have to use full path to npm (from node installation).
source

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am modifying the environment of the currently running PowerShell process, and not the User or System ones. So the forum post and the MSDN article are correct, but not applicable to the code. I can use the shorter syntax though, I did not know it.

We cannot use the full path to npm. This was my first approach and it failed - something (npm, dependencies, or our code) executes node without full path and the installation of the CLI fails because it cannot find node.exe.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, thanks for the explanation :)

@rosen-vladimirov
Copy link
Contributor

👍

teobugslayer added a commit that referenced this pull request Jan 28, 2016
Install node.js 4.2.5 - most stable at the moment
@teobugslayer teobugslayer merged commit 460e67e into master Jan 28, 2016
@teobugslayer teobugslayer deleted the totev/fix-npm-setup branch January 28, 2016 07:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants