but I was not sure I had this packages installed so I tried this:
$ sudo npm install -g angular-cookies
npm WARN unmet dependency /usr/local/lib/node_modules/npm/node_modules/npmconf requires once@'~1.1.1' but will load
npm WARN unmet dependency /usr/local/lib/node_modules/npm/node_modules/once,
npm WARN unmet dependency which is version 1.3.2
npm WARN unmet dependency /usr/local/lib/node_modules/npm/node_modules/npmconf requires mkdirp@'~0.3.3' but will load
npm WARN unmet dependency /usr/local/lib/node_modules/npm/node_modules/mkdirp,
npm WARN unmet dependency which is version 0.5.1
npm WARN unmet dependency /usr/local/lib/node_modules/npm/node_modules/npmconf requires osenv@'0.0.3' but will load
npm WARN unmet dependency /usr/local/lib/node_modules/npm/node_modules/osenv,
npm WARN unmet dependency which is version 0.1.3
npm WARN unmet dependency /usr/local/lib/node_modules/npm/node_modules/npmconf requires nopt@'2' but will load
npm WARN unmet dependency /usr/local/lib/node_modules/npm/node_modules/nopt,
npm WARN unmet dependency which is version 3.0.4
npm WARN unmet dependency /usr/local/lib/node_modules/npm/node_modules/npmconf requires semver@'2' but will load
npm WARN unmet dependency /usr/local/lib/node_modules/npm/node_modules/semver,
npm WARN unmet dependency which is version 5.0.3
npm WARN unmet dependency /usr/local/lib/node_modules/npm/node_modules/npmconf requires ini@'~1.1.0' but will load
npm WARN unmet dependency /usr/local/lib/node_modules/npm/node_modules/ini,
npm WARN unmet dependency which is version 1.3.4
npm WARN unmet dependency /usr/local/lib/node_modules/npm/node_modules/read-package-json/node_modules/normalize-package-data requires semver@'2' but will load
npm WARN unmet dependency /usr/local/lib/node_modules/npm/node_modules/semver,
npm WARN unmet dependency which is version 5.0.3
npm WARN unmet dependency /usr/local/lib/node_modules/npm/node_modules/read-package-json/node_modules/normalize-package-data requires github-url-from-git@'~1.1.1' but will load
npm WARN unmet dependency /usr/local/lib/node_modules/npm/node_modules/github-url-from-git,
npm WARN unmet dependency which is version 1.4.0
npm WARN unmet dependency /usr/local/lib/node_modules/npm/node_modules/read-installed/node_modules/readdir-scoped-modules requires graceful-fs@'^4.1.2' but will load
npm WARN unmet dependency /usr/local/lib/node_modules/npm/node_modules/read-installed/node_modules/graceful-fs,
npm WARN unmet dependency which is version 3.0.8
npm WARN unmet dependency /usr/local/lib/node_modules/phonegap/node_modules/phonegap-build requires colors@'0.6.x' but will load
npm WARN unmet dependency /usr/local/lib/node_modules/phonegap/node_modules/colors,
npm WARN unmet dependency which is version 0.6.0-1
npm WARN unmet dependency /usr/local/lib/node_modules/phonegap/node_modules/phonegap-build/node_modules/qrcode-terminal requires colors@'*' but will load
npm WARN unmet dependency /usr/local/lib/node_modules/phonegap/node_modules/colors,
npm WARN unmet dependency which is version 0.6.0-1
npm WARN unmet dependency /usr/local/lib/node_modules/phonegap/node_modules/prompt/node_modules/winston requires colors@'0.x.x' but will load
npm WARN unmet dependency /usr/local/lib/node_modules/phonegap/node_modules/colors,
npm WARN unmet dependency which is version 0.6.0-1
angular-cookies@1.4.7 /usr/local/lib/node_modules/angular-cookies
Angular resource and cookies should both be updated via bower.
The way to think about it is bower is mainly used for javascript/css code bases (bootstrap, angular, font awesome) where as npm is mainly used for things your local computer needs like compilers, run time commands, etc.
Though I don’t think your error is with Angular resource. Mind posting the entire error you are getting?
Sometimes when you update a bower component, you’ll be asked which version of a library you need to use. It will say something like
angular 1.3.7 is required by ionic.js but resolved to 1.4.0
angular 1.4.0 is required by ui-router but resolved to 1.4.0
…
please choose which version:
And what is happening is sometimes bower components require angular or another library, and you need to make sure you have the correct one installed.
It can be a tedious process at first. I remember I broke an app by upgrading and spent a few hours tracking down library versions or what not.
The best way to do it sometimes is to delete your bower_components folder and run bower install again. Just make sure your main bower.json is updated and has all the correct bower_components. Bower install will look at that file to check what to install.
Hope that helps with the mystery
and glad you got it working
I tracked back the changes, and this error happens when I try to upgrade ionic : ionic lib update.
It’s really weird because before upgrading like this, I get the following :
$ ionic info
Your system information:
Cordova CLI: 5.3.3
Gulp version: CLI version 3.9.0
Gulp local: Local version 3.9.0
Ionic Version: 1.1.0
Ionic CLI Version: 1.7.7
Ionic App Lib Version: 0.6.3
OS: Distributor ID: Ubuntu Description: Ubuntu 14.04.3 LTS
Node Version: v0.12.7
but in the file www/libe/ionic/js/ionic.bundle.min.js (which I call in my index.html), there is :
/*!
* Copyright 2014 Drifty Co.
* http://drifty.com/
*
* Ionic, v1.0.0-beta.13
* A powerful HTML5 mobile app framework.
I think it’s a big mess because there is also this directory www/lib/ionic/release/js/ where ionic.bundle.min.js is to version 1.1.0.
Can you help me clarify this please ?
About what you said, I understand what to put in my bower.json, I mean I don’t which version of the package should I use. Isn’t there a package manager that can manage dependencies for me ?
The package manager is the bower.json and package.json files. I’m not sure if there is a better library to help manage them, but I wouldn’t be surprised.
I would try deleting the bower_components folder, making sure your bower.json file has everything upto date or latest version, and then running bower install again.
ok thanks @DaDanny for your reply. So, you say the pacakges should all be at their latest version in bower.json ?
If yes, how can I know what is their latest version ?