javascript - git clone 下来的项目 想在本地运行 npm run install 报错
PHP中文网
PHP中文网 2017-04-17 16:31:03
0
1
605
PHP中文网
PHP中文网

认证0级讲师

reply all(1)
巴扎黑

Look to see if there is a .babelrc file. Have you forgotten this file?

In addition, the .babelrc file must have a react plugin.

Firstnpm install babel-plugin-import babel-plugin-react-transform --save-p

Then .babelrc must have at least these: ("stage-0" optional)

{
  "presets": ["react", "es2015", "stage-0"]
  //... 其他东西
}

In fact, you can also install more, such as adding these to devDependencies in package.json

    "babel-core": "^6.24.0",
    "babel-loader": "^6.4.1",
    "babel-plugin-import": "^1.1.1",
    "babel-plugin-react-transform": "^2.0.0",
    "babel-plugin-transform-decorators-legacy": "^1.3.4",
    "babel-plugin-transform-runtime": "^6.12.0",
    "babel-preset-es2015": "^6.14.0",
    "babel-preset-react": "^6.22.0",
    "babel-preset-stage-0": "^6.5.0",
    "babel-register": "^6.22.0",
    "babel-runtime": "^6.11.6",

Npm install will definitely solve the problem

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template