Babel无法使用ES6/Parser.pp.raise

问题描述:

当我尝试安装babel并使其工作时,出现所有这些错误都很让人困惑,希望有人能帮忙!Babel无法使用ES6/Parser.pp.raise

.babel_src

{ 
    "presets": ["es2015", "react", "stage-2"] 
} 

的package.json

{ 
    "name": "testing-application", 
    "version": "1.0.0", 
    "description": "", 
    "main": "index.js", 
    "scripts": { 
    "test": "mocha './src/**/*.spec.js' --compilers js:babel-core/register" 
    }, 
    "author": "", 
    "license": "ISC", 
    "devDependencies": { 
    "babel-core": "^6.7.2", 
    "babel-preset-es2015": "^6.6.0", 
    "babel-preset-react": "^6.5.0", 
    "babel-preset-stage-2": "^6.5.0", 
    "except": "^0.1.3", 
    "mocha": "^2.4.5", 
    "react": "^0.14.7", 
    "react-addons-test-utils": "^0.14.7", 
    "react-dom": "^0.14.7" 
    }, 
    "dependencies": { 
    "react": "^0.14.7", 
    "react-dom": "^0.14.7" 
    } 
} 

我得到以下错误:

Unexpected token (3:20) 
    1 | import except from 'except'; 
    2 | 
> 3 | describe('empty'() => { 
    |     ^
    4 | it("should workd",() => { 
    5 |  except(true).toEqual(true); 
    6 | }) 
    at Parser.pp.raise(/Users/tests/Documents/React-Redux-Applications/TestingApplication/node_modules/babel-core/node_modules/babylon/index.js:1378:13) 

我在ES6代码有错误!对不起,错误!