From: Chris F. <cf...@st...> - 2017-03-24 04:19:00
|
To answer my own question (funny how that happens!), the NPM config package.json needs the versions pinned for both angular and angular-mocks: diff --git a/opennms-webapp/package.json b/opennms-webapp/package.json index e166995..298482b 100644 --- a/opennms-webapp/package.json +++ b/opennms-webapp/package.json @@ -5,7 +5,8 @@ "postinstall": "./node_modules/bower/bin/bower install" }, "devDependencies": { - "angular-mocks": "^1.5.8", + "angular-mocks": "~1.5.8", + "angular": "~1.5.8", "bower": "^1.7.9", "gulp": "*", "gulp-rename": "^1.2.2”, Cheers, Chris > On 24 Mar 2017, at 11:53 am, Chris Foote <cf...@st...> wrote: > > Hi OpenNMS devs. > > I’m trying to build RPMs from source for 19.0.1 on CentOS 7 and the opennms-webapp fails tests to do with angular and angular-mocks modules: > > [INFO] --- frontend-maven-plugin:1.0:karma (execute karma tests) @ opennms-webapp --- > [INFO] Running 'karma start karma.conf.js' in /build/opennms-src/target/rpm/BUILD/opennms-19.0.1-0.20170221.1/opennms-webapp > [INFO] 24 03 2017 11:55:49.535:INFO [karma]: Karma v1.5.0 server started at http://0.0.0.0:9876/ > [INFO] 24 03 2017 11:55:49.539:INFO [launcher]: Launching browser PhantomJS with unlimited concurrency > [INFO] 24 03 2017 11:55:49.557:INFO [launcher]: Starting browser PhantomJS > [INFO] 24 03 2017 11:55:49.824:INFO [PhantomJS 2.1.1 (Linux 0.0.0)]: Connected on socket mr_GJvKbDKZ1RT5cAAAA with id 74107250 > [INFO] PhantomJS 2.1.1 (Linux 0.0.0) ERROR > [INFO] TypeError: undefined is not a function (evaluating 'angular.module('ngAnimateMock', ['ng']) > [INFO] .info({ angularVersion: '1.6.3' })') > [INFO] at node_modules/angular-mocks/angular-mocks.js:800 > > It appears to be an issue with Angular being version 1.6.3 and angular-mocks being version 1.5.8. According to the angular-mocks documentation, the version must match Angular. > > The bower.json config specifies version 1.5.8 of both modules, but 1.6.3 gets installed by maven & bower: > > [opennms@opennms-build opennms-webapp]$ ./node_modules/bower/bin/bower info angular > bower angular#* cached https://github.com/angular/bower-angular.git#1.6.3 > bower angular#* validate 1.6.3 against https://github.com/angular/bower-angular.git#* > > { > name: 'angular', > version: '1.6.3', > license: 'MIT', > main: './angular.js', > ignore: [], > dependencies: {}, > homepage: 'https://github.com/angular/bower-angular' > } > [snip] > > I am thinking that there might be some npm dependency that has brought in the newer version of Angular. I’m very inexperienced with nodejs, npm and bower, so I’m lost for ideas. > > > Has anyone got a fix for this ? > > > According to bower, version 1.6.3 of Angular isn’t installed: > > [opennms@opennms-build opennms-webapp]$ ./node_modules/bower/bin/bower list > bower check-new Checking for new versions of the project dependencies... > opennms /build/opennms-src/opennms-webapp > ├── angular#1.5.8 (latest is 1.6.4-build.5327+sha.233f47b) > ├─┬ angular-animate#1.5.8 (latest is 1.6.4-build.5327+sha.233f47b) > │ └── angular#1.5.8 (latest is 1.6.4-build.5327+sha.233f47b) > ├─┬ angular-bootstrap#2.1.3 (latest is 2.5.0) > │ └── angular#1.5.8 (1.6.4-build.5327+sha.233f47b available) > ├─┬ angular-cookies#1.5.8 (latest is 1.6.4-build.5327+sha.233f47b) > │ └── angular#1.5.8 > ├─┬ angular-growl-v2#0.7.9 > │ └── angular#1.5.8 (1.6.4-build.5327+sha.233f47b available) > ├─┬ angular-loading-bar#0.9.0 > │ └── angular#1.5.8 (1.6.4-build.5327+sha.233f47b available) > ├─┬ angular-mocks#1.5.8 extraneous (latest is 1.6.4-build.5327+sha.233f47b) > │ └── angular#1.5.8 > ├─┬ angular-resource#1.5.8 (latest is 1.6.4-build.5327+sha.233f47b) > │ └── angular#1.5.8 > ├─┬ angular-route#1.5.8 (latest is 1.6.4-build.5327+sha.233f47b) > │ └── angular#1.5.8 > ├─┬ angular-sanitize#1.5.8 (latest is 1.6.4-build.5327+sha.233f47b) > │ └── angular#1.5.8 > ├─┬ bootbox#4.4.0 > │ └─┬ bootstrap#3.3.1 (4.0.0-alpha.6 available) > │ └── jquery#2.2.4 (3.2.1 available) > ├── bootstrap#3.3.1 (latest is 4.0.0-alpha.6) > ├─┬ bootstrap-sass-official#3.3.1 (latest is 3.3.7) > │ └── jquery#2.2.4 (3.2.1 available) > ├─┬ c3#0.4.11 > │ └── d3#3.5.17 (latest is 4.7.3) > ├── d3#3.5.17 (latest is 4.7.3) > ├─┬ flot#0.8.3 > │ └── jquery#2.2.4 (3.2.1 available) > ├── flot-axislabels#0d6ae9a793 > ├─┬ flot-datatable#1.0.6 > │ ├── d3#3.5.17 (latest is 4.7.3) > │ └─┬ flot#0.8.3 > │ └── jquery#2.2.4 > ├─┬ flot-legend#2.0.0 > │ ├── d3#3.5.17 > │ └─┬ flot#0.8.3 > │ └── jquery#2.2.4 > ├── flot-navigate#v1.3-CUSTOM > ├── flot-saveas#1.0.0 > ├── flot.tooltip#0.8.7 (latest is 0.9.0) > ├── font-awesome#4.6.3 (latest is 4.7.0) > ├── ionicons#2.0.1 > ├── ip-address#5.8.2 (latest is 5.8.6) > ├── jquery#2.2.4 (latest is 3.2.1) > ├── jquery-sparkline#2.1.3 > ├─┬ jquery-treegrid#0.3.0 > │ ├── jquery#2.2.4 > │ └─┬ jquery.cookie#1.4.1 > │ └── jquery#2.2.4 (3.2.1 available) > ├─┬ jquery-ui#1.12.0 (latest is 1.12.1) > │ └── jquery#2.2.4 (3.2.1 available) > ├── leaflet#1.0.2 (latest is 1.0.3) > ├─┬ leaflet.markercluster#1.0.0 (latest is 1.0.4) > │ └── leaflet#1.0.2 (1.0.3 available) > ├── requirejs#2.2.0 (latest is 2.3.3) > └── underscore#1.8.3 > > > > — > Repeating build: > > git checkout master > git checkout opennms-19.0.1-1 > ./clean > ./makerpm.sh > > Doing a `/build/opennms-src/maven/bin/mvn compile -X` in the opennms-webapp directory reveals: > [INFO] --- frontend-maven-plugin:1.0:karma (execute karma tests) @ opennms-webapp --- > [DEBUG] Configuring mojo com.github.eirslett:frontend-maven-plugin:1.0:karma from plugin realm ClassRealm[plugin>com.github.eirslett:frontend-maven-plugin:1.0, parent: sun.misc.Launcher$AppClassLoader@70dea4e] > [DEBUG] Configuring mojo 'com.github.eirslett:frontend-maven-plugin:1.0:karma' with basic configurator --> > [DEBUG] (f) installDirectory = /build/opennms-src/opennms-webapp/target > [DEBUG] (f) karmaConfPath = karma.conf.js > [DEBUG] (f) project = MavenProject: org.opennms:opennms-webapp:19.0.1 @ /build/opennms-src/opennms-webapp/pom.xml > [DEBUG] (f) repositorySystemSession = org.eclipse.aether.DefaultRepositorySystemSession@1c93b51e > [DEBUG] (f) skip = false > [DEBUG] (f) skipTests = false > [DEBUG] (f) testFailureIgnore = false > [DEBUG] (f) workingDirectory = /build/opennms-src/opennms-webapp > [DEBUG] (f) execution = com.github.eirslett:frontend-maven-plugin:1.0:karma {execution: execute karma tests} > [DEBUG] -- end configuration -- > [INFO] Running 'karma start karma.conf.js' in /build/opennms-src/opennms-webapp > [INFO] 24 03 2017 12:15:20.505:INFO [karma]: Karma v1.5.0 server started at http://0.0.0.0:9876/ > [INFO] 24 03 2017 12:15:20.509:INFO [launcher]: Launching browser PhantomJS with unlimited concurrency > [INFO] 24 03 2017 12:15:20.525:INFO [launcher]: Starting browser PhantomJS > [INFO] 24 03 2017 12:15:20.760:INFO [PhantomJS 2.1.1 (Linux 0.0.0)]: Connected on socket qkOGseLtFytJJumoAAAA with id 97315042 > [INFO] PhantomJS 2.1.1 (Linux 0.0.0) ERROR > [INFO] TypeError: undefined is not a function (evaluating 'angular.module('ngAnimateMock', ['ng']) > [INFO] .info({ angularVersion: '1.6.3' })') > [INFO] at node_modules/angular-mocks/angular-mocks.js:800 > [INFO] > [INFO] > [INFO] ------------------------------------------------------------------------ > [INFO] BUILD FAILURE > [INFO] ------------------------------------------------------------------------ > [INFO] Total time: 17.774 s > [INFO] Finished at: 2017-03-24T12:15:20+11:00 > [INFO] Final Memory: 50M/521M > [INFO] ------------------------------------------------------------------------ > [ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.0:karma (execute karma tests) on project opennms-webapp: Failed to run task: 'karma start karma.conf.js' failed. (error code 1) -> [Help 1] > > Regards, > Chris > > > > > > ------------------------------------------------------------------------------ > Check out the vibrant tech community on one of the world's most > engaging tech sites, Slashdot.org! http://sdm.link/slashdot > _______________________________________________ > Please read the OpenNMS Mailing List FAQ: > http://www.opennms.org/index.php/Mailing_List_FAQ > > opennms-devel mailing list > > To *unsubscribe* or change your subscription options, see the bottom of this page: > https://lists.sourceforge.net/lists/listinfo/opennms-devel |