小编thl*_*lik的帖子

Haskell 如何管理它的内存?

因此,我们知道对于大多数语言来说,在程序的整个执行过程中:

  • 全局变量存储在静态内存中。
  • 局部变量存储在堆栈内存中。
  • 任意变化的变量存储在堆中。

哈斯克尔呢?我只知道它很懒。这如何转化为这种背景?

haskell functional-programming memory-management ghc

7
推荐指数
0
解决办法
832
查看次数

如何修复“throw er; // 未处理的‘错误’事件”?

我正在 React 中构建一个基本的随机报价机。但是当我运行npm start终端时,我得到了错误。

我在网上做了一些研究。我喜欢一个对我有用的解决方案。显然,降级我react-scrpts@3.1.1react-scripts@2.1.8工作。但是在我重新启动系统后,react-scripts 变回3.1.1并产生相同的错误。

错误信息是:

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

Error: ENOSPC: System limit for number of file watchers reached, watch '/home/samman/Documents/kkk/public'
    at FSWatcher.start (internal/fs/watchers.js:165:26)
    at Object.watch (fs.js:1258:11)
    at createFsWatchInstance (/home/samman/Documents/kkk/node_modules/chokidar/lib/nodefs-handler.js:38:15)
    at setFsWatchListener (/home/samman/Documents/kkk/node_modules/chokidar/lib/nodefs-handler.js:81:15)
    at FSWatcher.NodeFsHandler._watchWithNodeFs (/home/samman/Documents/kkk/node_modules/chokidar/lib/nodefs-handler.js:233:14)
    at FSWatcher.NodeFsHandler._handleDir (/home/samman/Documents/kkk/node_modules/chokidar/lib/nodefs-handler.js:429:19)
    at FSWatcher.<anonymous> (/home/samman/Documents/kkk/node_modules/chokidar/lib/nodefs-handler.js:477:19)
    at FSWatcher.<anonymous> (/home/samman/Documents/kkk/node_modules/chokidar/lib/nodefs-handler.js:482:16)
    at FSReqWrap.oncomplete (fs.js:154:5)
Emitted 'error' event at:
    at FSWatcher._handleError (/home/samman/Documents/kkk/node_modules/chokidar/index.js:260:10)
    at createFsWatchInstance (/home/samman/Documents/kkk/node_modules/chokidar/lib/nodefs-handler.js:40:5)
    at setFsWatchListener (/home/samman/Documents/kkk/node_modules/chokidar/lib/nodefs-handler.js:81:15)
    [... lines matching original stack …
Run Code Online (Sandbox Code Playgroud)

npm reactjs

6
推荐指数
1
解决办法
2547
查看次数