Package – A package can be a GitHub shorthand, a Git endpoint, a URL, and more. Eg: bootstrap
Package Manager – Package manager is collection of software tools that automates the process of installing, configuring, upgrading and removing any programs
- npm – node package manager
- npm is the default package manager for the JavaScript runtime environment Node.js.
- Installing nodejs & npm:
- To check node and npm successful installation
- Go to command line and enter
- npm -v
- node -v
- you should see the version numbers
- Go to command line and enter
- Installing package:
- npm install <package>
- npm install <package> –save
- npm install <package> –save-dev
- with version number
- npm install <package>@version
- bower – package manager for web
- bower is a command line utility
- has to be installed with npm
- Installing bower: (-g installs it globally)
- npm install -g bower
- bower requires node, npm and git
- bower init to initialize bower.json file
- Installing packages with bower
- bower install <package>
- bower install <package> -S (for saving in bower.json)
- bower install <package> -D (for saving in bower.json as devdependency)
- Issues git not found event after having git client tool
- solution:
- locate your git.exe file
- It’s usually located here – C:\Users\user\AppData\Local\GitHub\PortableGit_dGUID\cmd
- GUID changes when the git gets updated
- copy the path and paste it in command line
- enter ‘git’ command, if you see git help options that means git is working
- now copy the path, remove ‘.git.exe’ at the end and paste into PATH variable
- close and reopen the command line and try entering git command again. If everything goes right, git works!
- package.json file gets created with all dependencies. If not just enter, ‘npm init’ command
- solution:
- composer – A dependency manager for php
- Installing composer
- https://getcomposer.org/download/
- The installer will download composer for you and set up your PATH environment variable so you can simply call
composer
from any directory.
- Installing packages with composer:
- composer require twbs/bootstrap
- For php
- Eg:
- composer require phpmd/phpmd
- composer require –dev phpunit/phpunit
- Using phpunit from commandline
- .\vendor\bin\phpunit testFile.php
- Same pattern of execution for other modules installed with composer
- Using phpunit from commandline
- Eg:
- composer.json file gets created with all dependencies
- Installing composer
Advertisements