无法启动npm启动反应应用程序

时间:2017-07-28 10:30:50

标签: node.js reactjs npm

我对react app有疑问。我从git克隆它并运行命令npm install和npm start,我收到了这个错误。

SyntaxError: Unexpected token {
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:373:25)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Function.Module.runMain (module.js:441:10)
at startup (node.js:140:18)
at node.js:1043:3
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! front-end-react@0.1.0 build: `react-scripts build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the front-end-react@0.1.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/adeda/.npm/_logs/2017-07-28T10_14_54_951Z-debug.log

1 个答案:

答案 0 :(得分:5)

不要克隆存储库,只需全局安装库,然后使用给定的命令生成应用程序:

$ npm install -g create-react-app

$ create-react-app my-app
$ cd my-app/
$ npm start

https://github.com/facebookincubator/create-react-app#quick-overview