启动create-react-app项目期间出现未处理的错误

时间:2018-10-07 05:36:36

标签: reactjs create-react-app yarnpkg

我已经通过create-react-app创建了一个新项目。成功创建项目后,我试图通过点击命令yarn start来启动该项目,但它引发了我一个未处理的错误。

任何人都可以很好地解决这个问题。

Starting the development server...

events.js:183
      throw er; // Unhandled 'error' event
      ^

Error: watch /home/sagar/workspace/code-splitting/public ENOSPC
    at _errnoException (util.js:1022:11)
    at FSWatcher.start (fs.js:1382:19)
    at Object.fs.watch (fs.js:1408:11)
    at createFsWatchInstance (/home/sagar/workspace/code-splitting/node_modules/chokidar/lib/nodefs-handler.js:37:15)
    at setFsWatchListener (/home/sagar/workspace/code-splitting/node_modules/chokidar/lib/nodefs-handler.js:80:15)
    at FSWatcher.NodeFsHandler._watchWithNodeFs (/home/sagar/workspace/code-splitting/node_modules/chokidar/lib/nodefs-handler.js:232:14)
    at FSWatcher.NodeFsHandler._handleDir (/home/sagar/workspace/code-splitting/node_modules/chokidar/lib/nodefs-handler.js:414:19)
    at FSWatcher.<anonymous> (/home/sagar/w    Starting the development server...

events.js:183
      throw er; // Unhandled 'error' event
      ^

Error: watch /home/sagar/workspace/code-splitting/public ENOSPC
    at _errnoException (util.js:1022:11)
    at FSWatcher.start (fs.js:1382:19)
    at Object.fs.watch (fs.js:1408:11)
    at createFsWatchInstance (/home/sagar/workspace/code-splitting/node_modules/chokidar/lib/nodefs-handler.js:37:15)
    at setFsWatchListener (/home/sagar/workspace/code-splitting/node_modules/chokidar/lib/nodefs-handler.js:80:15)
    at FSWatcher.NodeFsHandler._watchWithNodeFs (/home/sagar/workspace/code-splitting/node_modules/chokidar/lib/nodefs-handler.js:232:14)
    at FSWatcher.NodeFsHandler._handleDir (/home/sagar/workspace/code-splitting/node_modules/chokidar/lib/nodefs-handler.js:414:19)
    at FSWatcher.<anonymous> (/home/sagar/workspace/code-splitting/node_modules/chokidar/lib/nodefs-handler.js:462:19)
    at FSWatcher.<anonymous> (/home/sagar/workspace/code-splitting/node_modules/chokidar/lib/nodefs-handler.js:467:16)
    at FSReqWrap.oncomplete (fs.js:153:5)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.orkspace/code-splitting/node_modules/chokidar/lib/nodefs-handler.js:462:19)
    at FSWatcher.<anonymous> (/home/sagar/workspace/code-splitting/node_modules/chokidar/lib/nodefs-handler.js:467:16)
    at FSReqWrap.oncomplete (fs.js:153:5)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

5 个答案:

答案 0 :(得分:1)

要解决此问题,您可以按照以下步骤操作。

首先,重新安装>>> l=list(map(str,l)) >>> list(map(pd.to_datetime,l)) [Timestamp('2018-10-07 00:00:00')]

node_modules

然后,启动项目:

rm -rf node_modules/ && npm i

npm start 

答案 1 :(得分:0)

重新安装依赖项是解决方案。

删除node_modules目录

然后:

yarn install

答案 2 :(得分:0)

使用npm install重新安装节点模块 并做

npx create-react-app my-app cd my-app npm start

答案 3 :(得分:0)

答案 4 :(得分:0)

信用:@ robininfo-edsx “当前错误是ENOSPC(空间不足) 它与权限没有直接关系,但通常与磁盘使用情况有关,当您达到文件限制时,您就可以观看。 作为root用户,监视的限制可能比正常使用要大,这就是sudo解决问题但不希望以root用户身份运行应用程序的原因。 尝试增加可监视文件的数量 https://stackoverflow.com/questions/22475849/node-js-error-enospc/32600959#32600959"