bower.json how to skip already installed packages - angularjs

In my application, all the packages except Chart and angular-chart are already installed.
I need to install only these two.
Question: How to skip the rest of the packages from being updated or downloaded again?
{
"name": "ui-chromeapp",
"version": "0.0.0",
"dependencies": {
"angular": "~1.2.23",
"angular-bootstrap": "~0.11.0",
"bootstrap": "~3.2.0",
"angular-ui-router": "~0.2.11",
"underscore": "~1.7.0",
"jquery.easy-pie-chart": "~2.1.4",
"sprintf": "~1.0.2",
"jquery.scrollTo":"~2.1.1",
"angular-translate":"~2.8.1",
"angular-translate-loader-static-files" : "~2.8.1",
"Chart.js" : "1.0.1"
},
"devDependencies": {},
"resolutions": {
"Chart.js": "1.0.1"
}
}

Hint: While using bower installcommand, after your ran it once before, no new packages / dependencies were installed. When using bower update new versions of your packages will be downloaded (depending on your bower.json configuration -> package version config). All in all, both commands do not install a package in the same package-version again.
Just remove the version option handlers and you wil be fine. It's not a issue, it's a nice behavior.
{
"name": "ui-chromeapp",
"version": "0.0.0",
"dependencies": {
"angular": "1.2.23",
"angular-bootstrap": "0.11.0",
"bootstrap": "3.2.0",
"angular-ui-router": "0.2.11",
"underscore": "1.7.0",
"jquery.easy-pie-chart": "2.1.4",
"sprintf": "1.0.2",
"jquery.scrollTo":"2.1.1",
"angular-translate":"2.8.1",
"angular-translate-loader-static-files" : "2.8.1",
"Chart.js" : "1.0.1"
},
"devDependencies": {},
"resolutions": {
"Chart.js": "1.0.1"
}
}

Related

fixing version problems in bower after installing Angular Material

I have a project which was using angular version 1.4. I installed angular material via bower and then subsequently received the following error:
Uncaught TypeError: angular.module(...).info is not a function
I read this was to do with the version of angular I'm using so I updated angular and then angular-animate to 1.6. However this didn't fix the problem. I tried running bower update but I still have the above error.
When I ran bower update I received the following warning...
Resort to using angular#~1.4.2 which resolved to angular#1.4.14
Code incompatibilities may occur.
this is the contents of my bower.json file:
{
"name": "node-template",
"version": "0.0.0",
"main": [
"./public/styles/*.css",
"./public/scripts/*.js"
],
"dependencies": {
"angular-animate": "1.6",
"angular-sanitize": "~1.4.2",
"angular-messages": "~1.4.2",
"bootstrap-sass": "~3.3.5",
"jquery": "~2.1.4",
"angular": "1.6",
"angular-ui-router": "~0.2.15",
"angular-bootstrap": "~2.5.0",
"angular-google-chart": "~0.1.0",
"velocity": "~1.4.2",
"animate.css": "~3.5.2",
"angular-file-saver": "~1.1.3",
"ng-file-upload": "~12.2.13",
"ng-img-crop": "ngImgCrop#~0.3.2",
"angularfire": "~2.3.0",
"angular-material": "~1.1.4"
},
"devDependencies": {
"angular-mocks": "~1.4.2"
},
"overrides": {},
"resolutions": {
"jquery": "~2.1.4",
"angular": "~1.4.2"
}
}
Is bower telling me I'm using version 1.4? I don't understand why it cannot resolve the version problems I'm encountering?
Edit:
here is my new bower.json after upgrading to angular 1.5:
{
"name": "node-template",
"version": "0.0.0",
"main": [
"./public/styles/*.css",
"./public/scripts/*.js"
],
"dependencies": {
"angular-animate": "1.4",
"angular-sanitize": "~1.4.2",
"angular-messages": "~1.4.2",
"bootstrap-sass": "~3.3.5",
"jquery": "~2.1.4",
"angular": "1.5",
"angular-ui-router": "~0.2.15",
"angular-bootstrap": "~2.5.0",
"angular-google-chart": "~0.1.0",
"velocity": "~1.4.2",
"animate.css": "~3.5.2",
"angular-file-saver": "~1.1.3",
"ng-file-upload": "~12.2.13",
"ng-img-crop": "ngImgCrop#~0.3.2",
"angularfire": "~2.3.0",
"angular-material": "~1.1.4"
},
"devDependencies": {
"angular-mocks": "~1.4.2"
},
"overrides": {},
"resolutions": {
"jquery": "~2.1.4",
"angular": "1.5"
}
}
You have Angular 1.4.14 installed. Looking at the bower.json for Angular Material the minimum version of AngularJS required for the package is 1.5 which is probably why you are having errors. Can you not update to AngularJS 1.5?
Failing that, I suggest you install an older version of Angular Material that is compatible with 1.4.x
The error I was seeing...
angular.module(...).info is not a function
...seems to arise when the version of angular-aria (required by angular-material) is newer than the version of angular. I managed to get my build working again by setting angular-aria to be the same version as angular.

Old Ionic project breaks after npm install & bower install on a new machine

I had an old Ionic project whose package.json file is like following:
{
"name": "example",
"version": "1.1.1",
"description": "example: An Ionic project",
"dependencies": {
"angular-messages": "^1.5.1",
"gulp": "^3.5.6",
"gulp-concat": "^2.2.0",
"gulp-minify-css": "^0.3.0",
"gulp-rename": "^1.2.0",
"gulp-sass": "^2.0.4"
},
"devDependencies": {
"bower": "^1.3.3",
"gulp-util": "^2.2.14",
"shelljs": "^0.3.0"
},
"cordovaPlugins": [
"cordova-plugin-device",
"cordova-plugin-console",
"cordova-plugin-whitelist",
"cordova-plugin-splashscreen",
"cordova-plugin-statusbar",
"ionic-plugin-keyboard"
],
"cordovaPlatforms": [
"android"
]
}
Bower.json:
{
"name": "HelloIonic",
"private": "true",
"dependencies": {
"angular": "~1.3.1",
"angular-route": "~1.3.1",
"angular-cookies": "~1.4.0",
"bootstrap": "~3.3.0",
"bootstrap-material-design": "~0.1.5",
"jquery": "~2.1.1",
"ngDialog": "~0.3.3",
"underscore": "~1.7.0",
"ionic": "^1.2.4",
"angular-resource": "^1.5.2",
"angular-google-chart": "^0.1.0",
"angular-ui-router-styles": "^1.1.0",
"angular-audio": "^1.7.2"
}
}
With these settings it is working on one of my machines since a few months. Today I tried to clone this repo on another machine and tried to set it up, but unfortunately ran into errors like $http(...).success is not a function & Error: transition superseded at $StateProvider.$get. Also, if I check in my developer console images are are not loaded.
I simply ran npm install ionic, npm install bower, npm install & then bower install. After that ionic serve
What I should do to run my project on these old settings without having to change my code?
UPDATE:
If I do angular.version in my developer console then I see full: "1.6.4", major: 1, minor: 6, dot: 4, codeName: "phenomenal-footnote" and for ionic.version: 1.2.4
however on old machine angular.version is 1.5.8 and ionic.version is 1.2.4

Getting .Fatal error: grunt.util._.contains is not a function while saving code after grunt debug

I have two version of grunt one global and one local.
grunt-cli v1.2.0
grunt v1.0.1
I want to uninstall v1.0.1.
When running grunt debug command it running successfully but while saving code am getting this fatal error:grunt.util._.contains is not a function.
bower.json
{
"name": "__",
"version": "__",
"devDependencies": {
"angular": "^1.5.5",
"angular-ui-router": "^0.2.18",
"angular-mocks": "^1.5.5",
"angular-bootstrap": "^1.3.2",
"ngstorage": "^0.3.10",
"bootstrap": "^3.3.6",
"angular-resource": "^1.2.28",
"ng-file-upload-shim": "^12.0.4",
"ng-file-upload": "^12.0.4"
},
"dependencies": {
"angularjs-slider": "^5.4.1"
}
}
package.json
{
"author": "....",
"name": "....",
"version": "1.0.0",
"homepage": ".....",
"licenses": {
"type": "MIT",
"url": "...."
},
"bugs": "....",
"repository": {
"type": "git",
"url": "..."
},
"dependencies": {},
"devDependencies": {
"grunt": "^1.0.1",
"grunt-bump": "0.0.6",
"grunt-coffeelint": "~0.0.10",
"grunt-contrib-clean": "^0.4.1",
"grunt-contrib-coffee": "^0.7.0",
"grunt-contrib-concat": "^0.3.0",
"grunt-contrib-copy": "^0.4.1",
"grunt-contrib-jshint": "^0.4.3",
"grunt-contrib-less": "~0.11.0",
"grunt-contrib-uglify": "^0.2.7",
"grunt-contrib-watch": "^0.4.4",
"grunt-conventional-changelog": "^0.1.2",
"grunt-html2js": "^0.1.9",
"grunt-karma": "^0.8.2",
"grunt-ng-annotate": "^0.8.0",
"karma": "^0.12.9",
"karma-coffee-preprocessor": "^0.2.1",
"karma-firefox-launcher": "^0.1.3",
"karma-jasmine": "^0.1.5"
}
}
It is due to incompatible grunt version, so I followed the below commands:
I Uninstalled Grunt:
>npm uninstall -g grunt
I Installed Grunt-cli:
>npm install -g grunt-cli
Then i checked the version:
>grunt --version
grunt-cli v1.2.0
grunt v1.0.1
I got the above response, but i needed grunt v0.4.5
Then i installed the needed grunt version:
npm install grunt#0.4.5 --save-dev
Now I don't get the above specified error.

AngularJS application deployment to Heroku, unable to find suitable angular-animate version

I am deploying an AngularJS application to Heroku but am getting this error in the console:
remote: bower ECONFLICT Unable to find suitable version for angular-animate
remote:
remote: ! Push rejected, failed to compile Node.js app
remote:
remote: Verifying deploy....
remote:
remote: ! Push rejected to test-app-12345
The problem (of course) seems to be with the angular-animate dependency.
I am using a Heroku angularJS buildpack "Yo Angular" and have followed their 4 step process for a successful application deployment to Heroku.
I tried fixing this by changing my bower.json file like recommended in this StackOverflow answer, hoping it would solve my issue. It did not.
Locally, I use grunt serve to start the application and that works for me just fine.
My bower.json looks like this:
{
"name": "dashboard",
"version": "0.0.0",
"main": "index.html",
"ignore": [
"**/.*",
"node_modules",
"bower_components"
],
"dependencies": {
"jquery": "~2.0",
"bootstrap": "~3.1.1",
"angular": "~1.3.15",
"angular-ui-router": "~0.2",
"angular-animate": "~1.3.15",
"angular-resource": "~1.3.15",
"angular-cookies": "~1.3.15",
"angular-mocks": "~1.3.15",
"angular-ui-utils": "~0.1",
"angular-bootstrap": "~0.11.2",
"moment": "~2.5",
"less.js": "~1.6",
"font-awesome": "~4.2.0",
"form-builder": "0.1.0",
"restangular": "~1.4.0",
"lodash": "~2.4.1",
"satellizer": "~0.3.2",
"angular-xeditable": "~0.1.8",
"fullcalendar": "~2.1.1",
"angular-ui-calendar": "~0.8.1",
"checklist-model": "~0.1.3"
},
"resolutions": {
"font-awesome": "~4.2.0",
"jquery": "~2.0",
"fullcalendar": "~2.1.1",
"angular": "~1.3.15",
"angular-bootstrap": "~0.11.2"
}
}
The code is public for now, so here is the link to the Github repo.
Anyone have tips for me, or a good idea of what I am doing wrong?
P.S. I found this information in bower's Github issues tracking, which is dealing with the same problem. Might be helpful in figuring this out.
This error occurs when two packages reference different versions of the same dependency.
You can resolve the issue by running rm -rf bower_components/ ; bower install
Then when prompted to choose a version prefix your answer with a "!" like I have below. Notice how bower will add a "resolutions" section.
Unable to find a suitable version for angular-animate, please choose one:
1) angular-animate#~1.2 which resolved to 1.2.28 and is required by form-builder#0.1.0
2) angular-animate#~1.3.15 which resolved to 1.3.17 and is required by dashboard
3) angular-animate#~1.4.3 which resolved to 1.4.3
Prefix the choice with ! to persist it to bower.json
? Answer: !3
Here is your resolved bower.json file.
{
"name": "dashboard",
"version": "0.0.0",
"main": "index.html",
"ignore": [
"**/.*",
"node_modules",
"bower_components"
],
"dependencies": {
"jquery": "~2.0",
"bootstrap": "~3.1.1",
"angular": "~1.3.15",
"angular-ui-router": "~0.2",
"angular-animate": "~1.4.3",
"angular-resource": "~1.3.15",
"angular-cookies": "~1.3.15",
"angular-mocks": "~1.3.15",
"angular-ui-utils": "~0.1",
"angular-bootstrap": "~0.11.2",
"moment": "~2.5",
"less.js": "~1.6",
"font-awesome": "~4.2.0",
"form-builder": "0.1.0",
"restangular": "~1.4.0",
"lodash": "~2.4.1",
"satellizer": "~0.3.2",
"angular-xeditable": "~0.1.8",
"fullcalendar": "~2.1.1",
"angular-ui-calendar": "~0.8.1",
"checklist-model": "~0.1.3"
},
"resolutions": {
"font-awesome": "~4.2.0",
"jquery": "~2.0",
"fullcalendar": "~2.1.1",
"angular": "~1.3.15",
"angular-bootstrap": "~0.11.2",
"angular-animate": "~1.4.3"
}
}

Bower Error: bower angular resolution unsuitable resolution

I got a fail response that bower angular resolution Unsuitable resolution declared for angular: 1.4.8 bower ECONFLICT Unable to find suitable version for angular
And my bower.json is
{
"name": "someet-backend",
"version": "0.0.0",
"private": true,
"dependencies": {
"angular-bootstrap": "0.14.2",
"angular-material": "0.11.1",
"angular-route": "1.4.7",
"angular-local-storage": "0.2.2",
"ng-lodash": "0.2.3",
"ng-file-upload": "6.0.2",
"angular-bootstrap-datetimepicker": "latest",
"angular-messages": "1.4.7",
"ng-tags-input": "~3.0.0",
"angular-jquery": "~0.2.1",
"textAngular": "v1.3.0-pre15",
"bootstrap": "~3.3.5",
"jquery": "~2.1.4",
"angular": "~1.4.8",
"moment": "~2.10.6"
},
"resolutions": {
"angular": "1.4.8"
}
}
I have try to degrade angular as
"resolutions": {
"angular": "1.4.7"
}
,
"resolutions": {
"angular": "1.4.6"
}
,
"resolutions": {
"angular": "1.3.0"
}
then return similar response result
Upgrade angular-route, angular-messages to match angular version 1.4.8
Upgrade Dev_dependencies as well as resolutions
"devDependencies": {
"angular-mocks": "~1.7.8",
"angular-route": "~1.7.8"
},
"resolutions": {
"angular": "1.7.8"
}

Resources