mirror of
https://github.com/webinstall/webi-installers.git
synced 2026-03-03 18:00:18 +00:00
get node install working in windows
This commit is contained in:
@@ -1,10 +1,21 @@
|
||||
mkdir %userprofile%\.local
|
||||
mkdir %userprofile%\.local\opt
|
||||
setlocal
|
||||
@echo off
|
||||
pushd "%userprofile%\.local\opt" || goto :error
|
||||
powershell $ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest https://nodejs.org/dist/v12.16.2/node-v12.16.2-win-x64.zip -OutFile node-v12.16.2-win-x64.zip || goto :error
|
||||
rem Windows BSD-tar handles zip. Imagine that.
|
||||
tar xf node-v12.16.2-win-x64.zip || goto :error
|
||||
dir
|
||||
rename node-v12.16.2-win-x64 node-v12.16.2 || goto :error
|
||||
rmdir node-v12.16.2-win-x64
|
||||
del node-v12.16.2-win-x64.zip || goto :error
|
||||
popd || goto :error
|
||||
|
||||
pushd %userprofile%\.local\opt
|
||||
powershell $ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest https://nodejs.org/dist/v12.16.2/node-v12.16.2-win-x64.zip -OutFile node-v12.16.2-win-x64.zip
|
||||
tar xf node-v12.16.2-win-x64.zip
|
||||
move node-v12.16.2-win-x64 node-v12.16.2
|
||||
popd
|
||||
rem make npm not act stupid about which node to use... ugh (this should be the default)
|
||||
"%userprofile%\.local\opt\node-v12.16.2\npm.cmd" --scripts-prepend-node-path=true config set scripts-prepend-node-path true
|
||||
pathman add .local\opt\node-v12.16.2 || goto :error
|
||||
|
||||
pathman add %userprofile%\.local\opt\node-v12.16.2\bin
|
||||
goto :EOF
|
||||
|
||||
:error
|
||||
echo Failed with error #%errorlevel%.
|
||||
exit /b %errorlevel%
|
||||
|
||||
Reference in New Issue
Block a user