create-react-library无法运行npm start

时间:2017-11-16 21:18:03

标签: node.js npm

我从https://github.com/UdiliaInc/create-react-library克隆了create-react-library,但无法启动它。

我没有编辑。我运行了npm install,然后是npm start。当我运行npm start时,我得到了下面帖子中描述的相同错误。

Nodejs npm scripts fail with "SyntaxError: Unexpected token {"

我检查了我的节点版本,它是5.3.0。可能发生这种情况的任何其他原因?

错误是

  `[clynch@localhost create-react-library]$ npm start

create-react-library@1.0.0 start /home/clynch/git/create-react-library
node scripts/start.js

/home/clynch/git/create-react-library/scripts/start.js:23
    const { choosePort,
          ^

    SyntaxError: Unexpected token {
        at exports.runInThisContext (vm.js:53:16)
        at Module._compile (module.js:374:25)
        at Object.Module._extensions..js (module.js:405:10)
        at Module.load (module.js:344:32)
        at Function.Module._load (module.js:301:12)
        at Function.Module.runMain (module.js:430:10)
        at startup (node.js:141:18)
        at node.js:980:3
    npm ERR! code ELIFECYCLE
    npm ERR! errno 1
    npm ERR! create-react-library@1.0.0 start: `node scripts/start.js`
    npm ERR! Exit status 1
    npm ERR! 
    npm ERR! Failed at the create-react-library@1.0.0 start 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/clynch/.npm/_logs/2017-11-16T21_05_24_465Z-debug.log
    `

1 个答案:

答案 0 :(得分:1)

您应该将节点版本更新为6.12或7 +

供参考,请查看http://node.green/