Swiip / generator-gulp-angular

Yeoman generator for AngularJS with GulpJS [UNMAINTAINED next iteration is FountainJS]
http://fountainjs.io
3.72k stars 665 forks source link

Error when using Topcoat #182

Closed vko-online closed 9 years ago

vko-online commented 9 years ago

Bower dependency

   {
  "name": "empty",
  "version": "0.0.0",
  "dependencies": {
    "modernizr": "~2.8.3",
    "angular-animate": "~1.3.4",
    "angular-cookies": "~1.3.4",
    "angular-touch": "~1.3.4",
    "angular-sanitize": "~1.3.4",
    "restangular": "~1.4.0",
    "angular-route": "~1.3.4",
    "angular": "~1.3.4",
    "topcoat": null
  },
  "devDependencies": {
    "angular-mocks": "~1.3.4"
  },
  "resolutions": {
    "angular": "~1 .3.4"
  }
}
   gulp.task('fonts', function () {
     return gulp.src($.mainBowerFiles())
       .pipe($.filter('**/*.{eot,svg,ttf,woff}')) //fonts in Topcoat are in "otf" format, but even adding it here doesn't solve issue
       .pipe($.flatten())
       .pipe(gulp.dest('dist/fonts/'));
   });

Error

Running 'fonts'...
[11:58:57] Using gulpfile ~/dev/projects/lancer/gulpfile.js
[11:58:57] Starting 'fonts'...
[11:58:57] 'fonts' errored after 17 ms
[11:58:57] SyntaxError: Unexpected token

    at Object.parse (native)
    at Object.PackageCollection.collectPackages (/home/bwin/dev/projects/lancer/node_modules/main-bower-files/lib/package_collection.js:72:30)
    at Object.PackageCollection (/home/bwin/dev/projects/lancer/node_modules/main-bower-files/lib/package_collection.js:29:10)
    at Object.module.exports (/home/bwin/dev/projects/lancer/node_modules/main-bower-files/lib/index.js:60:22)
    at Gulp.<anonymous> (/home/bwin/dev/projects/lancer/gulp/build.js:98:21)
    at module.exports (/home/bwin/dev/projects/lancer/node_modules/gulp/node_modules/orchestrator/lib/runTask.js:34:7)
    at Gulp.Orchestrator._runTask (/home/bwin/dev/projects/lancer/node_modules/gulp/node_modules/orchestrator/index.js:273:3)
    at Gulp.Orchestrator._runStep (/home/bwin/dev/projects/lancer/node_modules/gulp/node_modules/orchestrator/index.js:214:10)
    at Gulp.Orchestrator.start (/home/bwin/dev/projects/lancer/node_modules/gulp/node_modules/orchestrator/index.js:134:8)
    at /usr/lib/node_modules/gulp/bin/gulp.js:129:20

Exception points this line

 bowerJson = JSON.parse(
                stripJsonComments(
                    fs.readFileSync(this.opts.paths.bowerJson, 'utf8')
                )
            ),
zckrs commented 9 years ago

In your bower.json "topcoat": null should be "topcoat": "~0.8.0"

vko-online commented 9 years ago

"topcoat": null means latest

Toilal commented 9 years ago

Use "latest" instead of null.

http://stackoverflow.com/questions/18815655/how-to-set-package-latest-version-in-bower