Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Configurar Node.js em rede privada com Squid Proxy
@echo off
set proxy=
set loglevel=http
:: Intro
echo Configuracao NODE JS & echo.
echo Entre com o login de rede. & echo.
set /p login=login:
echo. & echo.
echo Entre com a senha de rede (certifique-se de que ninguem esta olhando). & echo.
set /p senha=senha:
set proxy=http://%login%:%senha%@%proxy%/
echo. & echo. & echo Aguarde...
:: Define proxies
call npm config set proxy=%proxy%
call npm config set http-proxy=%proxy%
call npm config set https-proxy=%proxy%
echo. & echo. & echo USANDO PROXY: %proxy%
:: Define NPM loglevel
call npm config set loglevel=%loglevel%
echo LOGLEVEL: %loglevel%
:: Define EMAIL
call npm config set email=%login%@%domain%
echo EMAIL: %login%@%domain%
:: Create node modules if it does not exists
set node_modules=%APPDATA%\npm\node_modules
if not exist %node_modules% mkdir %node_modules%
:: Set NODE_PATH pointing to npm global modules
call setx -m NODE_PATH "%APPDATA%\npm\node_modules" >nul
echo NODE_PATH: "%NODE_PATH%" & echo.
:: END
echo. & echo. & echo NODE JS E NPM PRONTOS! & echo.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment