vishnu
vishnu

Reputation: 4599

How to use local(project folder) installed ionic version instead global

I am having older ionic version which installed globally using -g option. For the new project i have installed new ionic version without -g option.

 npm install ionic@latest

If i try to run any ionic commands, It was always using the globally installed ionic version. Is it possible to point locally installed version?

Because, i do not want to update the ionic for the old project.

Upvotes: 6

Views: 3503

Answers (1)

SolveSoul
SolveSoul

Reputation: 2648

If you run npm install then there should be a .bin folder in your node_modules. If you have a different version of Ionic specified in your package.json then there should be a file ionic inside the .bin folder.

Example of the ionic entry in the devDependencies in the package.json:

"devDependencies": {
    "ionic": "^3.0.0",
}

To use this version of Ionic you can simply run:

./node_modules/.bin/ionic <your_ionic_command_here>

Upvotes: 10

Related Questions