0

I am getting this npm / Angular error:

$ npm install ionic-native --save
[email protected] /home/louisro/Documents/mobileApps/BoardLine/ionic_version
├── UNMET PEER DEPENDENCY @angular/core@>=2.0.0-rc.0 <2.0.0-rc.5
└── [email protected] 

npm WARN @ionic/[email protected] requires a peer of @angular/core@>=2.0.0-rc.0 <2.0.0-rc.5 but none was installed.

How can I fix it?

6
  • did you try removing npm_modules and reinstalling. Commented Jan 17, 2017 at 16:10
  • no, but am I gonna loose all my npm modules doing this ? Commented Jan 17, 2017 at 16:48
  • no, I don't where is this directory, I just see node_modulesin my project root Commented Jan 17, 2017 at 16:54
  • All the dependencies should be mentioned in package.json . When you do npm install , modules will be rebuilt . default ionic project already have ionic-native Commented Jan 17, 2017 at 16:56
  • sorry i meant node_modules Commented Jan 17, 2017 at 16:56

1 Answer 1

1

You could remove node_modules and reinstall packages with npm install. This would look for all the dependencies in dependencies attribute of package.json and install them.

How does package.json know the dependencies of your project? Well you asked it to ( or should have ). When you do npm install <pkg-name> --save it install the package in node_modules and --save adds it in package.json dependencies.

So an npm install would add all the packages back that are mentioned in package.json and its dependencies too. Hope it helps.

Sign up to request clarification or add additional context in comments.

1 Comment

@Louis happy to help.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.