在WebStorm中创build反应应用程序

我正在尝试使用npm软件包“create-react-app”开始使用WebStorm的反应项目。

我已经运行npm install -g create-react-app来全局安装这个软件包,并且可以通过命令行(比如create-react-app <proj name> )完美地使用这个软件包。

但是,当在WebStorm中创build项目并使用全局“create-react-app”包(使用npm list -gfind)的path时,会遇到以下错误:

 /usr/bin/node /usr/local/lib/node_modules/create-react-app/index.js . /usr/local/lib/node_modules/create-react-app/createReactApp.js:589 .filter(file => !validFiles.includes(file)); ^ TypeError: validFiles.includes is not a function at /usr/local/lib/node_modules/create-react- app/createReactApp.js:589:33 at Array.filter (native) at isSafeToCreateProjectIn (/usr/local/lib/node_modules/create- react-app/createReactApp.js:589:6) at createApp (/usr/local/lib/node_modules/create-react- app/createReactApp.js:147:8) at Object.<anonymous> (/usr/local/lib/node_modules/create-react- app/createReactApp.js:134:1) at Module._compile (module.js:410:26) at Object.Module._extensions..js (module.js:417:10) at Module.load (module.js:344:32) at Function.Module._load (module.js:301:12) at Module.require (module.js:354:17) Done 

我在某个时候出错了吗?

事实certificate,我有节点版本4,创build反应,应用程序需要版本> = 6 – 虽然此警告不显示通过WebStorm“运行”面板。

因此,我通过使用nvm更新到节点v6.11.3来解决此问题。