React project - spread operator in node module unexpected token
问题 I'm building a react application, and I'm importing a node module which uses the spread operator ... and I'm getting an error "Module parse failed: Unexpected token (100:6)" at this operator. How can I get this to work? Thanks 回答1: The create-react-app cli has already bundled this ES2015 feature. Older babel does not support this and needs to be installed separately Now assuming you setup your react manually and not using the create-react-app. You can set up this by installing the package