javascript - git clone 下來的項目 想在本地運行 npm run install 報錯
問題描述
問題解答
回答1:你看看有沒有 .babelrc 這個文件,是不是你把這個文件給忘了。
另外 .babelrc 文件中要有react插件。
先npm install babel-plugin-import babel-plugin-react-transform --save-p
然后 .babelrc 中至少要有這些:('stage-0'可選)
{ 'presets': ['react', 'es2015', 'stage-0'] //... 其他東西}
其實你也可以多裝一些,比如在package.json中的devDependencies加上這些
'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肯定能解決問題
相關文章:
1. python 利用subprocess庫調用mplayer時發(fā)生錯誤2. python文檔怎么查看?3. python - Pycharm的Debug用不了4. javascript - 關于apply()與call()的問題5. datetime - Python如何獲取當前時間6. javascript - nginx反向代理靜態(tài)資源403錯誤?7. html - eclipse 標簽錯誤8. 請問PHPstudy中的數(shù)據(jù)庫如何創(chuàng)建索引9. 安全性測試 - nodejs中如何防m(xù)ySQL注入10. python - pycharm 自動刪除行尾空格
