2016-07-25 64 views
2

所以我完全被這個困惑了。我的團隊在同一分支上運行,代碼相同。我是唯一有這個問題的人。下面是完整的堆棧跟蹤:模塊構建失敗:ReferenceError:[BABEL]未知選項:/Users/Will/.babelrc.presets

Module build failed: ReferenceError: [BABEL] /Users/Will/Brandzooka/visibl-front_end/node_modules/eslint-loader/index.js!/Users/Will/Brandzooka/visibl-front_end/app/index.jsx: Unknown option: /Users/Will/.babelrc.presets 
    at Logger.error (/Users/Will/Brandzooka/visibl-front_end/node_modules/babel-core/lib/transformation/file/logger.js:58:11) 
    at OptionManager.mergeOptions (/Users/Will/Brandzooka/visibl-front_end/node_modules/babel-core/lib/transformation/file/options/option-manager.js:126:29) 
    at OptionManager.addConfig (/Users/Will/Brandzooka/visibl-front_end/node_modules/babel-core/lib/transformation/file/options/option-manager.js:107:10) 
    at OptionManager.findConfigs (/Users/Will/Brandzooka/visibl-front_end/node_modules/babel-core/lib/transformation/file/options/option-manager.js:168:35) 
    at OptionManager.init (/Users/Will/Brandzooka/visibl-front_end/node_modules/babel-core/lib/transformation/file/options/option-manager.js:229:12) 
    at File.initOptions (/Users/Will/Brandzooka/visibl-front_end/node_modules/babel-core/lib/transformation/file/index.js:147:75) 
    at new File (/Users/Will/Brandzooka/visibl-front_end/node_modules/babel-core/lib/transformation/file/index.js:137:22) 
    at Pipeline.transform (/Users/Will/Brandzooka/visibl-front_end/node_modules/babel-core/lib/transformation/pipeline.js:164:16) 
    at transpile (/Users/Will/Brandzooka/visibl-front_end/node_modules/babel-loader/index.js:12:22) 
    at Object.module.exports (/Users/Will/Brandzooka/visibl-front_end/node_modules/babel-loader/index.js:69:12) 

我已經遇到多個答案,所有涉及到通天塔6的使用,其目前並不適用於我。

我已經試過:

  • 卸載和(通過NVM)重新安裝節點,NPM版本
  • 吹走所有的節點模塊,並重新安裝
  • NPM緩存清理
  • 吹走回購,並重新克隆
  • 爲了好措施,重新啓動我的機器

進出口運行節點v0.12.9 & NPM v2.14.9

這裏是我的package.json

{ 
    "version": "0.0.0", 
    "main": "app/index.js", 
    "private": true, 
    "scripts": { 
    "build": "CONFIG_ENV=dev Q_DEBUG=1 time ./node_modules/.bin/webpack --config conf/webpack.production.js", 
    "build:prod": "CONFIG_ENV=production time ./node_modules/.bin/webpack --config conf/webpack.production.js", 
    "build:stage": "CONFIG_ENV=stage time ./node_modules/.bin/webpack --config conf/webpack.production.js", 
    "deploy:codeship-getvisibl": "time firebase deploy --token $FIREBASETOKEN", 
    "deploy:codeship-stage": "time firebase deploy --token $FIREBASETOKEN --project firebase-visibl-stage", 
    "deploy:stage": "firebase use firebase-visibl-stage && firebase deploy", 
    "lint": "PATH=$PATH:/usr/local/bin time ./node_modules/eslint/bin/eslint.js --cache --format 'node_modules/eslint-friendly-formatter' --ext .js --ext .jsx --config .eslintrc app/", 
    "migrate": "babel-node --stage 1 migrate.js", 
    "start": "CONFIG_ENV=dev Q_DEBUG=1 ./node_modules/.bin/webpack-dev-server --config conf/webpack.config.js --hot --progress --inline --content-base ./build", 
    "start:prod": "CONFIG_ENV=production Q_DEBUG=1 ./node_modules/.bin/webpack-dev-server --config conf/webpack.config.js --hot --progress --inline --content-base ./build", 
    "debug": "CONFIG_ENV=dev Q_DEBUG=1 time ./node_modules/.bin/mocha debug --full-trace --colors --recursive app/mochaNodeSetup.js app", 
    "test": "CONFIG_ENV=dev Q_DEBUG=1 time ./node_modules/.bin/mocha --full-trace --colors --bail --recursive app/mochaNodeSetup.js app" 
    }, 
    "dependencies": { 
    "@brandzooka/client": "*", 
    "@brandzooka/models": "*", 
    "autoprefixer-loader": "2.0.0", 
    "aws-sdk": "^2.3.7", 
    "babel-core": "5.8.38", 
    "babel-loader": "5.3.2", 
    "baconjs": "0.7.66", 
    "bluebird": "2.10.1", 
    "bootstrap-sass": "3.3.5", 
    "bootstrap-slider": "4.10.0", 
    "chai": "3.0.0", 
    "chai-immutable": "1.0.2", 
    "classnames": "2.1.2", 
    "clear-require": "^1.0.1", 
    "cls-bluebird": "^1.0.1", 
    "css-loader": "0.15.1", 
    "dom-scroll-into-view": "1.2.0", 
    "eslint": "1.4.3", 
    "eslint-friendly-formatter": "1.0.8", 
    "eslint-loader": "^1.0.0", 
    "eslint-plugin-mocha": "0.4.0", 
    "eslint-plugin-react": "3.4.1", 
    "exports-loader": "0.6.2", 
    "file-loader": "0.8.4", 
    "immutable": "3.7.4", 
    "immutable-form-validation": "1.0.4", 
    "imports-loader": "0.6.4", 
    "jquery": "2.1.4", 
    "jsdom": "2.0.0", 
    "json-loader": "0.5.2", 
    "lodash": "3.10.1", 
    "mocha": "2.2.5", 
    "moment": "2.10.3", 
    "node-libs-browser": "0.5.2", 
    "node-sass": "3.2.0", 
    "nomnom": "^1.8.1", 
    "null-loader": "0.1.1", 
    "phantomjs": "1.9.18", 
    "precommit-hook": "2.0.1", 
    "q": "1.4.1", 
    "query-string": "3.0.3", 
    "rc-form-validation": "2.4.12", 
    "react": "^0.14.0", 
    "react-addons-pure-render-mixin": "0.14.0", 
    "react-addons-test-utils": "0.14.0", 
    "react-bootstrap": "0.29.5", 
    "react-bootstrap-daterangepicker": "0.2.5", 
    "react-dom": "0.14.0", 
    "react-dropzone": "1.2.2", 
    "react-hot-loader": "1.2.7", 
    "react-moment-proptypes": "0.0.5", 
    "react-router": "0.13.5", 
    "react-slick": "0.12.2", 
    "readline2": "^1.0.1", 
    "reflux": "0.4.1", 
    "reflux-core": "0.3.0", 
    "reflux-promise": "1.0.4", 
    "sass-loader": "1.0.2", 
    "sha.js": "2.4.5", 
    "sinon": "1.15.4", 
    "sinon-chai": "2.8.0", 
    "sinon-react": "0.2.1", 
    "style-loader": "0.12.3", 
    "superagent": "1.2.0", 
    "superagent-promise": "1.0.0", 
    "url": "0.10.3", 
    "url-loader": "0.5.6", 
    "uuid": "2.0.2", 
    "valid-url": "1.0.9", 
    "whatwg-fetch": "0.9.0" 
    }, 
    "devDependencies": { 
    "babel": "5.8.38", 
    "babel-eslint": "^6.0.0-beta.6", 
    "chai-spies": "^0.7.1", 
    "clean-webpack-plugin": "0.1.3", 
    "estraverse": "^4.2.0", 
    "extract-text-webpack-plugin": "0.8.2", 
    "firebase-token-generator": "^2.0.0", 
    "html-webpack-plugin": "1.5.2", 
    "pg": "^4.4.2", 
    "pg-parse-float": "0.0.1", 
    "webpack": "*", 
    "webpack-dev-server": "*" 
    } 
} 

任何熱的想法了嗎? 3個小時,我什至不能得到錯誤信息改變。

回答

4

的配置路徑/Users/Will/.babelrc.presets意味着你有一個.babelrc文件中/Users/Will/,因爲它似乎是一個配置文件用於巴貝爾6.它有一個"presets"關鍵

想必你/Users/Will/Brandzooka/visibl-front_end/.babelrc.babelrc配置您的巴貝爾5安裝,但Babel 5不會停止向上尋找其他配置,除非您告訴它(在第一次配置時,Babel 6停止),所以它也會看起來更遠,並在主目錄中的Babel 6配置中出錯。

這讓你有幾個選擇:

  • 刪除/Users/Will/.babelrc,因爲巴貝爾配置文件應該生活在他們申請,而不是在你家的項目。
  • 如果這是一個禁行,打開(也許創建)/Users/Will/Brandzooka/visibl-front_end/.babelrc並確保它有密鑰"breakConfig": true告訴Babel 5停止查看其他配置文件的父目錄。
相關問題