Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialRebekah Shaw
18,687 PointsWhy am I getting an error when trying to install angular/http@2.4.2
When i try to run npm install @angular/https@2.4.2 --save --save-exact I get the following error.
npm WARN photoblog@ No repository field.
npm WARN photoblog@ No license field.
Any reason why this is?:
1 Answer
Neil McPartlin
14,662 PointsHi Rebekah.
1: I think you will find that both of those warning messages refer to your own main 'package.json' file associated with your 'photoblog' app. They are just warnings and your code should still run fine but I understand why you would rather not be seeing them. NPM assumes you are operating a live production installation and it is warning you about package.json entries that need to be corrected.
Assuming that instead you are in a dev environment, you can edit that file to stop those messages. I Googled and found these 2 example posts that discuss these issues.
https://stackoverflow.com/questions/16827858/npm-warn-package-json-no-repository-field
In this one, it suggest ways by which you can mark your app as being 'private'.
And in this one, it talks about the various licence options from which you can choose. A few people mention that setting your app to private might solve this problem too.
2: I note in passing that you wrote npm install @angular/https@2.4.2 --save --save-exact
where --save is written twice. Maybe this is just a typo in your post here. I was unaware of 'exact' but I do see --save-exact discussed here.
Rebekah Shaw
18,687 PointsRebekah Shaw
18,687 PointsYeah I realised that my code works even though I see this error, thank you for your help.