2013-10-07 5 views
1

Образец бранч сессии:TypeError: Не удается прочитать свойство «sortingLevel» неопределенной

$ npm -v 
1.2.25 
$ brunch -V 
1.7.6 
$ bower -v 
1.2.7 
$ brunch new https://github.com/monokrome/brunch-with-grits.git example 
... 
$ cd example 
$ ls 
app bower_components bower.json config.coffee node_modules package.json README.md vendor 
$ ls bower_components/ 
backbone backbone.babysitter backbone.marionette.subrouter backbone.wreqr jquery lodash marionette underscore 
$ brunch build 
06 Oct 22:25:49 - info: compiled 9 files into 3 files, copied index.html in 761ms 
$ bower install -S https://github.com/whyohwhyamihere/backbone.marionette.subrouter.git 
... 
$ grep marionette bower.json 
    "marionette": "~1.0.4", 
    "backbone.marionette.subrouter": "https://github.com/whyohwhyamihere/backbone.marionette.subrouter.git" 
    "marionette": { 
     "main": "lib/core/backbone.marionette.js" 
$ cp bower.json bower.json.orig 
$ vi bower.json 
... 
$ diff bower.json bower.json.orig 
47,52d46 
<  }, 
<  "backbone.marionette.subrouter": { 
<  "main": "backbone.marionette.subrouter.js", 
<  "dependencies": { 
<   "marionette": "*" 
<  } 
$ brunch build 
/home/icyrockcom/nvm/v0.11.3/lib/node_modules/brunch/node_modules/read-components/index.js:164 
    var level = Math.max(pkg.sortingLevel || 0, initial); 
          ^
TypeError: Cannot read property 'sortingLevel' of undefined 
    at setLevel (/home/icyrockcom/nvm/v0.11.3/lib/node_modules/brunch/node_modules/read-components/index.js:164:29) 
    at /home/icyrockcom/nvm/v0.11.3/lib/node_modules/brunch/node_modules/read-components/index.js:169:7 
    at Array.forEach (native) 
    at setLevel (/home/icyrockcom/nvm/v0.11.3/lib/node_modules/brunch/node_modules/read-components/index.js:168:10) 
    at Array.forEach (native) 
    at setSortingLevels (/home/icyrockcom/nvm/v0.11.3/lib/node_modules/brunch/node_modules/read-components/index.js:175:12) 
    at sortPackages (/home/icyrockcom/nvm/v0.11.3/lib/node_modules/brunch/node_modules/read-components/index.js:181:10) 
    at /home/icyrockcom/nvm/v0.11.3/lib/node_modules/brunch/node_modules/read-components/index.js:211:20 
    at /home/icyrockcom/nvm/v0.11.3/lib/node_modules/brunch/node_modules/read-components/index.js:144:7 
    at /home/icyrockcom/nvm/v0.11.3/lib/node_modules/brunch/node_modules/async-each/index.js:24:44 
    at /home/icyrockcom/nvm/v0.11.3/lib/node_modules/brunch/node_modules/read-components/index.js:101:7 
    at /home/icyrockcom/nvm/v0.11.3/lib/node_modules/brunch/node_modules/read-components/index.js:49:7 
    at fs.js:253:14 
    at /home/icyrockcom/nvm/v0.11.3/lib/node_modules/brunch/node_modules/init-skeleton/node_modules/rimraf/node_modules/graceful-fs/graceful-fs.js:103:5 
    at Object.oncomplete (fs.js:94:15) 

Любые идеи, почему это не работает? marionette, так как зависимость включена, поэтому не должно терпеть неудачу.

+0

выглядит хорошо для меня. должен работать –

ответ

0

Я столкнулся с той же проблемой, и оказалось, что у меня был brunch, установленный глобально и локально. Ака, я установил его с npm install -g brunch И определил ли он его в моем package.json.

Удалите его с package.json (или удалите его по всему миру) и попробуйте снова.

+0

Спасибо Jonathan - в моем случае, похоже, что я не устанавливал его локально, так что, возможно, что-то еще здесь играет. –

Смежные вопросы