install-npm.bat 540 B

1234567891011121314151617181920212223242526272829
  1. @echo off
  2. chcp 65001 >nul
  3. title Install npm
  4. cd /d "%~dp0"
  5. if not exist "node.exe" (
  6. echo [ERROR] node.exe not found in current directory.
  7. echo Place Node.js in nodejs/node first.
  8. echo.
  9. pause
  10. exit /b 1
  11. )
  12. echo Installing npm to node_modules...
  13. "%CD%\node.exe" "%~dp0..\bootstrap-npm.js"
  14. if errorlevel 1 (
  15. echo.
  16. echo [ERROR] npm install failed
  17. echo.
  18. if not "%~1"=="/q" pause
  19. exit /b 1
  20. ) else (
  21. echo.
  22. echo [OK] npm installed successfully
  23. echo.
  24. if not "%~1"=="/q" pause
  25. exit /b 0
  26. )