-
Notifications
You must be signed in to change notification settings - Fork 3
NpmInstallation
Install mojito-cli
globally using npm with
% npm install --global mojito-cli
This makes the mojito
command available from the command line.
Details of installation are in the npm install docs. Users must have the path displayed with this command in their $PATH
:
npm prefix --global
Your mojito
application should declare it's dependencies in it's package.json file, as described here. For Mojito apps, that means putting something like the following in your package.json:
"dependencies": {
"mojito": "~0.5.7"
}
... where "mojito", the npm package name, is a key of the dependencies object. It's value is a version number or range.
In continuous integration (CI) workflows, it might be useful to declare mojito-cli
as a devDependency in your package.json:
"devDependencies": {
"mojito-cli": "~0.0.5"
}
This way commands like jslint
, test
, and docs
can be made available to your CI scripts along with your application and it's other dependencies.
Note, this requires [email protected]
or later. Earlier Mojito versions prevented mojito-cli
from being installed locally at the same time as mojito
.
However, in both cases, your CI scripts can invoke the cli commands the same way. For example:
node_modules/.bin/mojito test app .
After declaring your application's dependencies, they can be installed by running npm install
in the top level of your application directory.
-
mojito create app
will create an empty Mojito application with a package.json, and donpm install
in your newly created application directory. - to install Mojito locally and add it as a dependency in your package.json at the same time, try:
npm install --save mojito
- to install the Mojito CLI locally and add it as a devDependency in your package.json at the same time, try:
npm install --save-dev mojito-cli