Using Bauer and Branch Together on Hereka

All the examples that I saw online using them together rely on Bower installed globally, but this cannot work on Heroku. Bower must be application dependent, so it is listed in package.json .

My package.json looks like this:

 { "repository": { }, "dependencies": { "babel-brunch": "^6.0.0", "brunch": "^2.0.0", "clean-css-brunch": ">= 1.0 < 1.8", "css-brunch": ">= 1.0 < 1.8", "javascript-brunch": ">= 1.0 < 1.8", "uglify-js-brunch": ">= 1.0 < 1.8", "sass-brunch": "^1.9.2", "bower": "1.7.0" }, "scripts": { "postinstall": "./node_modules/bower/bin/bower install" } } 

And my bower.json like this:

 { "name": "Kaderi", "dependencies": { "bootstrap-sass": "~ 3.3.6" } } 

However, when loading bower in package.json I always get the following JS error when creating assets:

 ./node_modules/detective/node_modules/acorn/dist/acorn.js:1747 throw err; ^ SyntaxError: Unexpected token (2:10) at Parser.pp.raise (./node_modules/detective/node_modules/acorn/dist/acorn.js:1745:13) at Parser.pp.unexpected (./node_modules/detective/node_modules/acorn/dist/acorn.js:2264:8) at Parser.pp.semicolon (./node_modules/detective/node_modules/acorn/dist/acorn.js:2243:59) at Parser.pp.parseExpressionStatement (./node_modules/detective/node_modules/acorn/dist/acorn.js:2677:8) at Parser.pp.parseStatement (./node_modules/detective/node_modules/acorn/dist/acorn.js:2462:160) at Parser.pp.parseBlock (./node_modules/detective/node_modules/acorn/dist/acorn.js:2692:21) at Parser.pp.parseStatement (./node_modules/detective/node_modules/acorn/dist/acorn.js:2443:19) at Parser.pp.parseTopLevel (./node_modules/detective/node_modules/acorn/dist/acorn.js:2379:21) at Object.parse (./node_modules/detective/node_modules/acorn/dist/acorn.js:101:12) at parse (./node_modules/detective/index.js:9:18) at Function.exports.find (./node_modules/detective/index.js:44:15) at module.exports (./node_modules/detective/index.js:23:20) at ./node_modules/deppack/index.js:83:12 at tryToString (fs.js:414:3) at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:401:12) 

I don't know if this is caused by Bower itself, or bootstrap-sass / jquery (installed via Bower).

If I use the global Bower installation, the problem does not appear, but my assets cannot be compiled by Brunch on Heroku (due to the lack of Bower dependencies).

In fact, the problem is identical to this Brunch installed with the phoenix application does not work with bower assets , and I also use Phoenix, but for me the problem could not be solved by updating Phoenix (and I do not know how this will affect Bower / Brunch).

What am I missing in this tangled web of JavaScript frameworks?

edit: Using nodejs v5.1.1 and npm v3.3.12 both locally and on Heroku.

+5
source share

Source: https://habr.com/ru/post/1239130/


All Articles