Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- :: Ensure this Node.js and npm are first in the PATH
- set PATH=%CD%;%PATH%
- set NODE_PATH=%CD%\npm\node_modules
- :: This is required below
- setlocal enabledelayedexpansion
- :: Figure out the Node.js version
- set print_version=.\node.exe -p -e "process.versions.node + ' (' + process.arch + ')'"
- for /F "usebackq delims=" %%v in (`%print_version%`) do set version=%%v
- :: Print message
- if exist npm.cmd (
- echo Your environment has been set up for using Node.js !version! and npm.
- ) else (
- echo Your environment has been set up for using Node.js !version!.
- )
- :: Set the location of globally installed npm modules
- npm config set prefix "/dev/nodejs/npm" -g
- :: Required for 'npm install' to work correctly in Windows
- npm config set python /dev/python/python.exe --global
Advertisement
Add Comment
Please, Sign In to add comment