事件。js:141 er扔;/ /未处理的“错误”事件

时间:2021-02-28 00:09:12

I'm trying to run node 4.2.2 on a Mac OS and i'm not understanding why every time i get this error message:

我正在尝试在Mac OS上运行node 4.2.2,我不明白为什么每次我收到这个错误消息时:

events.js:141
      throw er; // Unhandled 'error' event
      ^
Error: spawn /Users/user/Documents/Projects/project-x/node_modules/gifsicle/vendor/gifsicle ENOENT
    at exports._errnoException (util.js:874:11)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:178:32)
    at onErrorNT (internal/child_process.js:344:16)
    at doNTCallback2 (node.js:441:9)
    at process._tickCallback (node.js:355:17)
c12320:project-x user$ 

What's going wrong? If i run "gulp build" there is this output:

什么错了吗?如果我运行“吞咽构建”,则有以下输出:

c12320:project-x user$ gulp build
[15:13:41] Using gulpfile ~/Documents/Projects/project-x/gulpfile.js
    [15:13:41] Starting 'clean'...
    [15:13:41] Finished 'clean' after 160 μs
    [15:13:41] Starting 'build'...
    [15:13:41] Starting 'copy-assets'...
    [15:13:41] Finished 'copy-assets' after 13 ms
    [15:13:41] Starting 'minify-img'...
    [15:13:41] Starting 'compile-css'...
    [15:13:41] Starting 'compile-js'...
    [15:13:41] Finished 'build' after 52 ms
    [15:13:41] 'minify-img' errored after 468 ms
    [15:13:41] Error: EACCES: permission denied, mkdir '/Users/user/Documents/Projects/project-x/public/assets/img/dummy'
        at Error (native)

    assets/js/00-bootstrap.js
      line 3  col 5  Missing "use strict" statement.

      ✖  1 error  ⚠  0 warning

    [15:13:41] Plumber found unhandled error:
     Error: EACCES: permission denied, open '/Users/user/Documents/Projects/project-x/public/assets/css/develop.css'

    assets/js/dev/lib/lodash.js
      line 13    col 5    Missing "use strict" statement.
      line 13    col 9    Expected an identifier and instead saw 'undefined' (a reserved word).
      line 217   col 12   Strings must use singlequote.
      line 227   col 21   Strings must use singlequote.
      line 249   col 12   Strings must use singlequote.
      line 249   col 17   Strings must use singlequote.
      line 263   col 67   Expected '===' and instead saw '=='.
      line 374   col 31   Expected '===' and instead saw '=='.
      line 386   col 24   Expected '===' and instead saw '=='.
      line 565   col 44   Expected '!==' and instead saw '!='.
      line 565   col 81   Expected '===' and instead saw '=='.
      line 577   col 42   Expected '===' and instead saw '=='.
      line 589   col 85   Expected '===' and instead saw '=='.
      line 589   col 103  Expected '===' and instead saw '=='.
      line 589   col 123  Expected '===' and instead saw '=='.
      line 589   col 143  Expected '===' and instead saw '=='.
      line 590   col 62   Expected '===' and instead saw '=='.
      line 590   col 82   Expected '===' and instead saw '=='.
      line 590   col 102  Expected '===' and instead saw '=='.
      line 590   col 122  Expected '===' and instead saw '=='.
      line 590   col 142  Expected '===' and instead saw '=='.
      line 590   col 163  Expected '===' and instead saw '=='.
      line 805   col 54   Unexpected use of '>>>'.
      line 814   col 38   Missing '()' invoking a constructor.
      line 995   col 33   Missing '()' invoking a constructor.
      line 995   col 13   The body of a for in should be wrapped in an if statement to filter unwanted properties from the prototype.
      line 1037  col 42   Expected '!==' and instead saw '!='.
      line 1063  col 66   Expected '!==' and instead saw '!='.
      line 1208  col 72   Expected '===' and instead saw '=='.
      line 1208  col 95   Expected '===' and instead saw '=='.
      line 1226  col 36   Expected '===' and instead saw '=='.
      line 1229  col 40   Expected '===' and instead saw '=='.
      line 1229  col 59   Blocks are nested too deeply. (4)
      line 1231  col 36   Blocks are nested too deeply. (4)
      line 1278  col 26   Expected '===' and instead saw '=='.
      line 1291  col 26   Expected '!==' and instead saw '!='.
      line 1305  col 23   Expected '!==' and instead saw '!='.
      line 1323  col 66   Missing '()' invoking a constructor.
      line 1340  col 42   Expected '===' and instead saw '=='.
      line 1355  col 32   Expected '===' and instead saw '=='.
      line 1400  col 44   Expected an assignment or function call and instead saw an expression.
      line 1416  col 27   'arrayEach' was used before it was defined.
      line 1678  col 17   Bad line breaking before '?'.
      line 1721  col 29   Expected '===' and instead saw '=='.
      line 1722  col 17   Bad line breaking before '?'.
      line 1737  col 38   Expected '===' and instead saw '=='.
      line 1764  col 35   Expected an assignment or function call and instead saw an expression.
      line 1788  col 24   Expected '===' and instead saw '=='.
      line 1790  col 21   Bad line breaking before '?'.
      line 1793  col 24   Expected '===' and instead saw '=='.
      line 1793  col 24   Too many errors. (14% scanned).

      ✖  2 errors
      ⚠  49 warnings


    assets/js/dev/lib/modernizr.js
      line 2  col 12449  This character may get silently deleted by one or more browsers.
      line 2  col 3272   Missing "use strict" statement.
      line 2  col 3308   Missing semicolon.
      line 2  col 3368   Expected '{' and instead saw 'if'.
      line 2  col 3509   Expected '{' and instead saw 'for'.
      line 2  col 3548   Blocks are nested too deeply. (4)
      line 2  col 3548   Expected '{' and instead saw 'A'.
      line 2  col 3615   Strings must use singlequote.
      line 2  col 3648   Expected '{' and instead saw 'o'.
      line 2  col 3668   Strings must use singlequote.
      line 2  col 3772   Do not use Boolean as a constructor.
      line 2  col 3845   Strings must use singlequote.
      line 2  col 3851   Strings must use singlequote.
      line 2  col 3863   Strings must use singlequote.
      line 2  col 3864   Expected an assignment or function call and instead saw an expression.
      line 2  col 3865   Missing semicolon.
      line 2  col 3952   Strings must use singlequote.
      line 2  col 4036   Strings must use singlequote.
      line 2  col 4053   Strings must use singlequote.
      line 2  col 4073   Strings must use singlequote.
      line 2  col 4082   Strings must use singlequote.
      line 2  col 4083   Missing semicolon.
      line 2  col 4124   Strings must use singlequote.
      line 2  col 4137   Strings must use singlequote.
      line 2  col 4200   Expected an assignment or function call and instead saw an expression.
      line 2  col 4201   Missing semicolon.
      line 2  col 4235   Strings must use singlequote.
      line 2  col 4237   Expected '===' and instead saw '=='.
      line 2  col 4246   Expected '{' and instead saw 'for'.
      line 2  col 4261   Expected '{' and instead saw 'hasOwnProp'.
      line 2  col 4292   Expected an assignment or function call and instead saw an expression.
      line 2  col 4246   The body of a for in should be wrapped in an if statement to filter unwanted properties from the prototype.
      line 2  col 4334   Strings must use singlequote.
      line 2  col 4360   Expected '===' and instead saw '=='.
      line 2  col 4393   Strings must use singlequote.
      line 2  col 4395   Expected '!==' and instead saw '!='.
      line 2  col 4404   Expected '{' and instead saw 'return'.
      line 2  col 4433   Strings must use singlequote.
      line 2  col 4435   Expected '===' and instead saw '=='.
      line 2  col 4453   Expected '===' and instead saw '=='.
      line 2  col 4551   Do not use Boolean as a constructor.
      line 2  col 4625   Expected '!==' and instead saw '!='.
      line 2  col 4629   Strings must use singlequote.
      line 2  col 4635   Strings must use singlequote.
      line 2  col 4647   Strings must use singlequote.
      line 2  col 4673   Expected an assignment or function call and instead saw an expression.
      line 2  col 4674   Missing semicolon.
      line 2  col 4691   Missing semicolon.
      line 2  col 4733   Strings must use singlequote.
      line 2  col 4735   Expected '!==' and instead saw '!='.
      line 2  col 4735   Too many errors. (40% scanned).

      ✖  2 errors
      ⚠  49 warnings

    [15:13:42] Plumber found unhandled error:
     Error: EACCES: permission denied, open '/Users/user/Documents/Projects/project-x/public/assets/js/app-load.js'
    events.js:141
          throw er; // Unhandled 'error' event
          ^

    Error: EACCES: permission denied, open '/Users/user/Documents/Projects/project-x/public/assets/font/text/125eafff-7b5a-4c56-8a3a-d3fe11d8c3cc.svg'
        at Error (native)
    c12320:project-x user$ 

That's the output if i enter "gulp build"

这是输入"吞咽构建"的输出

8 个解决方案

#1


75  

Check whether any other Terminal is running other Applications on the same port. This happens when multiple applications trying to access the same port, Its always FIFO.

检查其他终端是否在同一端口上运行其他应用程序。当多个应用程序试图访问同一个端口时,总是FIFO。

Good Luck!!!

祝你好运! ! !

#2


12  

First Look for the other applications is running on the same port may be another node application.

首先寻找其他应用程序在同一个端口上运行可能是另一个节点应用程序。

To find the current process running on the same port use:

查找在相同端口上运行的当前进程的使用:

MAC:

麦克:

You can try netstat

你可以试试netstat

netstat -anp tcp | grep 3000

For OSX "El Capitan" or if your netstat doesn't support -p, use lsof

对于OSX“El Capitan”或者如果你的netstat不支持-p,使用lsof

lsof -i tcp:3000 

Then kill the process

然后杀死过程

kill pid

You can try to kill all node process use:

可以尝试删除所有节点进程使用:

killall -9 node

#3


1  

Fixed the problem. There was a problem with the permissions for assets - if gulp can't take all assets. Then always there will displayed an error. I deleted the assets manually. I think i must be careful with(out) the "sudo" - command...

固定的问题。资产的许可存在一个问题——如果gulp不能获取所有资产。然后总是会显示一个错误。我手动删除了资产。我认为我必须小心处理“sudo”命令……

#4


0  

ENOENT means that spawn was unable to find the binary you are looking for. Make sure that what ever you are trying to spawn is in your path.

ENOENT意味着衍生无法找到你正在寻找的二进制文件。确保你想要的东西在你的道路上。

In this case you probably don't have gifsicle installed.

在这种情况下,您可能没有安装gifsicle。

#5


0  

this would not pertain to your error, but that error code can also run if a person is running node on multiple servers with the same address at the same time from their terminal.

这与您的错误无关,但是如果一个人在多个服务器上运行节点,同时从他们的终端上同时运行同一个地址,那么这个错误代码也可以运行。

#6


0  

Did you install imagemagick ?

你安装了imagemagick吗?

brew install imagemagick

#7


0  

I had this same error at work on my Mac Book Pro. None of the solutions fixed it. I finally fixed the problem by restarting my computer. I often don't shut my computer off at night and put it in sleep mode so if your computer has been running for a long time try restarting it and see if that works for you.

我在Mac Book Pro上也犯了同样的错误。没有一种解决方案能解决这个问题。我终于通过重启电脑解决了这个问题。我通常不会在晚上关掉电脑,把它放在睡眠模式中,如果你的电脑运行了很长时间,试着重新启动它,看看它是否对你有用。

#8


0  

so it throw an error ,Unhandled 'error' event,which means you need handle the error event,add function on this event and print the error,you will find the reason and your program will act normal.

它抛出一个错误,未处理的错误事件,这意味着你需要处理错误事件,在这个事件上添加函数并打印错误,你会找到原因,你的程序会正常运行。

#1


75  

Check whether any other Terminal is running other Applications on the same port. This happens when multiple applications trying to access the same port, Its always FIFO.

检查其他终端是否在同一端口上运行其他应用程序。当多个应用程序试图访问同一个端口时,总是FIFO。

Good Luck!!!

祝你好运! ! !

#2


12  

First Look for the other applications is running on the same port may be another node application.

首先寻找其他应用程序在同一个端口上运行可能是另一个节点应用程序。

To find the current process running on the same port use:

查找在相同端口上运行的当前进程的使用:

MAC:

麦克:

You can try netstat

你可以试试netstat

netstat -anp tcp | grep 3000

For OSX "El Capitan" or if your netstat doesn't support -p, use lsof

对于OSX“El Capitan”或者如果你的netstat不支持-p,使用lsof

lsof -i tcp:3000 

Then kill the process

然后杀死过程

kill pid

You can try to kill all node process use:

可以尝试删除所有节点进程使用:

killall -9 node

#3


1  

Fixed the problem. There was a problem with the permissions for assets - if gulp can't take all assets. Then always there will displayed an error. I deleted the assets manually. I think i must be careful with(out) the "sudo" - command...

固定的问题。资产的许可存在一个问题——如果gulp不能获取所有资产。然后总是会显示一个错误。我手动删除了资产。我认为我必须小心处理“sudo”命令……

#4


0  

ENOENT means that spawn was unable to find the binary you are looking for. Make sure that what ever you are trying to spawn is in your path.

ENOENT意味着衍生无法找到你正在寻找的二进制文件。确保你想要的东西在你的道路上。

In this case you probably don't have gifsicle installed.

在这种情况下,您可能没有安装gifsicle。

#5


0  

this would not pertain to your error, but that error code can also run if a person is running node on multiple servers with the same address at the same time from their terminal.

这与您的错误无关,但是如果一个人在多个服务器上运行节点,同时从他们的终端上同时运行同一个地址,那么这个错误代码也可以运行。

#6


0  

Did you install imagemagick ?

你安装了imagemagick吗?

brew install imagemagick

#7


0  

I had this same error at work on my Mac Book Pro. None of the solutions fixed it. I finally fixed the problem by restarting my computer. I often don't shut my computer off at night and put it in sleep mode so if your computer has been running for a long time try restarting it and see if that works for you.

我在Mac Book Pro上也犯了同样的错误。没有一种解决方案能解决这个问题。我终于通过重启电脑解决了这个问题。我通常不会在晚上关掉电脑,把它放在睡眠模式中,如果你的电脑运行了很长时间,试着重新启动它,看看它是否对你有用。

#8


0  

so it throw an error ,Unhandled 'error' event,which means you need handle the error event,add function on this event and print the error,you will find the reason and your program will act normal.

它抛出一个错误,未处理的错误事件,这意味着你需要处理错误事件,在这个事件上添加函数并打印错误,你会找到原因,你的程序会正常运行。