Installing Mobiscroll with NPM
Using the Mobiscroll CLI and loading assets from NPM
Levi Kovacs avatar
Written by Levi Kovacs
Updated over a week ago

You can install Mobiscroll with the help of the CLI or load it directly from NPM.

Using the CLI

The Mobiscroll CLI can be installed with NPM and YARN and was designed to help with configuring your projects and easily install the assets.

Install the CLI with NPM 

$ npm install -g @mobiscroll/cli

Install the CLI with YARN

$ yarn global add @mobiscroll/cli

Run mobiscroll config in the root folder of your app

$ mobiscroll config ionic

$ mobiscroll config angular

$ mobiscroll config angularjs

$ mobiscroll config javascript

$ mobiscroll config jquery

$ mobiscroll config react

Enter the email address or user name and password of your Mobiscroll account when prompted. You can change or update credentials it in your account.

Setting up for CI/CD

The config command will create a file named .npmrc in the project root, containing the access tokens to the Mobiscroll NPM registry. Commit this file into the repository to ensure the package will install for other team members and in CI/CD environments.

When used with Yarn 2 or 3, a different file is used, named .yarnrc.yml. Make sure this is also added to the repository.

When used with Docker, make sure to copy the .npmrc or .yarnrc.yml file together with package.json, to make sure that the install process will have access to the Mobiscroll NPM registry. Here's a Dockerfile example:

FROM node:18.12.0 as build

ENV NODE_ENV production

WORKDIR /app

COPY package.json package-lock.json .npmrc ./

RUN npm install

COPY . .

# ...

Using NPM

You will have to log in and assign the @mobiscroll scope to the mobiscroll npm registry. Use your user name and password that can be updated in your account.

NOTE: This method will not work with the trial version. For the trial version use the CLI as described above.

$ npm login --registry=https://npm.mobiscroll.com --scope=@mobiscroll

Install the package that you want to use

  • Javascript: $ npm install @mobiscroll/javascript 

  • jQuery: $ npm install @mobiscroll/jquery  

  • Angular JS: $ npm install @mobiscroll/angularjs  

  • Angular: $ npm install @mobiscroll/angular  

  • React: $ npm install @mobiscroll/react 

NOTE: NPM support is available for Framework and Complete licenses.

What's next?

Did this answer your question?