簡體   English   中英

未處理的“錯誤”事件

[英]Unhandled 'error' event

我正在嘗試Web應用程序打包程序包,並按照Github描述進行操作。 我的html和javascript文件在下面。

我的parcel index.html給出以下錯誤,

Error: watch /node_modules/babel-plugin-transform-react-jsx-source ENOSPC
at exports._errnoException (util.js:1020:11)
at FSWatcher.start (fs.js:1451:19)
at Object.fs.watch (fs.js:1478:11)
at createFsWatchInstance (/usr/lib/node_modules/parcel-bundler/node_modules/chokidar/lib/nodefs-handler.js:37:15)
at setFsWatchListener (/usr/lib/node_modules/parcel-bundler/node_modules/chokidar/lib/nodefs-handler.js:80:15)
at FSWatcher.NodeFsHandler._watchWithNodeFs (/usr/lib/node_modules/parcel-bundler/node_modules/chokidar/lib/nodefs-handler.js:232:14)
at FSWatcher.NodeFsHandler._handleDir (/usr/lib/node_modules/parcel-bundler/node_modules/chokidar/lib/nodefs-handler.js:414:19)
at FSWatcher.<anonymous> (/usr/lib/node_modules/parcel-bundler/node_modules/chokidar/lib/nodefs-handler.js:462:19)
at FSWatcher.<anonymous> (/usr/lib/node_modules/parcel-bundler/node_modules/chokidar/lib/nodefs-handler.js:467:16)
at FSReqWrap.oncomplete (fs.js:123:15)

events.js:160 throw er; //未處理的“錯誤”事件^

index.html

<!DOCTYPE HTML>
   <head>
    <title>Add two numbers</title>
    <script type="text/javascript" src="index.js">
    </script>
    </script>
</head>
<body>
    Enter the first number: <input type="text" id="txt1" /><br /> Enter the seccond number: <input type="text" id="txt2" /><br />
    <input type="button" onclick="call()" value="Add" />
</body>
</html>

下面是index.js文件:

   function call() {
    var q = parseInt(document.getElementById("txt1").value);
    var w = parseInt(document.getElementById("txt2").value);
    var result = q + w;
    if (isNaN(q) || isNaN(w)) {
        alert("please enter a number");
    } else

    {

        var result = q + w;
        alert("The sum is " + result);
    }

}

我確實認為,通過此處討論的修復程序至少可以部分解決此問題:

https://github.com/parcel-bundler/parcel/issues/1308

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM