繁体   English   中英

运行gulp event.js:136时出现“未处理的'错误'事件”

[英]I am getting an “Unhandled 'error' event” while running gulp event.js:136

我想用gulp编译时出现错误

events js: 136

我通过恢复可以工作的node_module文件夹尝试了几种修改

我找不到解决方案。 你可以帮帮我吗?

 (function() { var childProcess = require("child_process"); var oldSpawn = childProcess.spawn; function mySpawn() { console.log('spawn called'); console.log(arguments); var result = oldSpawn.apply(this, arguments); return result; } childProcess.spawn = mySpawn; })(); edit : after typing the command sudo gem install -n /usr/local/bin compass here is what is displayed 
 package configuration for libffi is not found "xcrun clang -o conftest -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/include/ruby-2.3.0/universal-darwin16 -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.$ In file included from conftest.c:1: In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/include/ruby-2.3.0/ruby.h:33: /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/include/ruby-2.3.0/ruby/ruby.h:24:10: fatal error: 'ruby/config.h' file not found #include "ruby/config.h" ^~~~~~~~~~~~~~~ 1 error generated. checked program was: /* begin */ 1: #include "ruby.h" 2: 3: int main(int argc, char **argv) 4: { 5: return 0; 6: } /* end */ 
 throw er; // Unhandled "error" event ^ Error: spawn /usr/local/bin/compass ENOENT at _errnoException (util.js:1031:13) at Process.ChildProcess._handle.onexit (internal/child_process.js:201:19) at onErrorNT (internal/child_process.js:389:16) at _combinedTickCallback (internal/process/next_tick.js:138:11) at process._tickCallback (internal/process/next_tick.js:180:9) I've been trying to chart the course : 

这是日志文件的内容!!! 找不到libffi的软件包配置“ xcrun clang -o conftest -I / Library / Developer / CommandLineTools / SDKs / MacOSX.sdk / System / Library / Frameworks / Ruby.framework / Versions / 2.3 / usr / include / ruby​​-2.3 .0 / universal-darwin16 -I / Library / Developer / CommandLineTools / SDKs / MacOSX.sdk / System / Library / Frameworks / Ruby.framework / Versions / 2.3 / usr / include / ruby​​-2.3.0 / ruby​​ / backward -I /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/include/ruby-2.3.0 -I。-D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT-操作系统-pipe -DHAVE_GCC_ATOMIC_BUILTINS -iwithsysroot / usr / local / libressl / include conftest.c -L。-L / System / Library / Frameworks / Ruby.framework / Versions / 2.3 / usr / lib -L。-L / Applications / Xcode .app / Contents / Developer / Platforms / MacOSX.platform / Developer / SDKs / MacOSX10.12.Internal.sdk / usr / local / libressl / lib -L ​​/ Applications / Xcode.app / Contents / Developer / Platforms / MacOSX.platform /Developer/SDKs/MacOSX10.12.Internal.sdk/usr/local/l ib -arch x86_64 -arch i386 -lruby.2.3.0 -lpthread -ldl -lobjc“在conftest.c中包含的文件中:1:在/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library中包含的文件中/Frameworks/Ruby.framework/Versions/2.3/usr/include/ruby-2.3.0/ruby.h:33:/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/版本/2.3/usr/include/ruby-2.3.0/ruby/ruby.h:24:10:致命错误:未找到“ ruby​​ / config.h”文件

包括“ ruby​​ / config.h”

^ ~~~~~~~~~~~~~~产生1个错误。 检查的程序为:/ *开始* / 1:#include“ ruby​​.h” 2:3:int main(int argc,char ** argv)4:{5:返回0; 6:}`/ * end * /我将检查指南针文档,看它是否来自那里! 预先感谢您的帮助。 所以我尝试使用以下命令安装指南针:

gem update --system,这是答案:

Updating rubygems-update Fetching: rubygems-update-2.7.8.gem (100%) ERROR: While executing gem ... (Gem::FilePermissionError) You don't have write permissions for the /Library/Ruby/Gems/2.3.0 directory. 我仍然尝试其他命令看看! 代码:
gem安装指南针: Fetching: ffi-1.9.25.gem (100%) ERROR: While executing gem ... (Gem::FilePermissionError) You don't have write permissions for the /Library/Ruby/Gems/2.3.0 directory.

所以我在这里尝试了几件事:

xcode-select --install xcode-select:错误:命令行工具已经安装,请使用“软件更新”来安装更新

xcode-select -v xcode-select版本2347。

gem environment RubyGems Environment: - RUBYGEMS VERSION: 2.7.8 - RUBY VERSION: 2.3.7 (2018-03-28 patchlevel 456) [universal.x86_64-darwin16] - INSTALLATION DIRECTORY: /Library/Ruby/Gems/2.3.0 - USER INSTALLATION DIRECTORY: /Users/toto/.gem/ruby/2.3.0 - RUBY EXECUTABLE: /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby - EXECUTABLE DIRECTORY: /usr/bin - SPEC CACHE DIRECTORY: /Users/toto/.gem/specs - SYSTEM CONFIGURATION DIRECTORY: /Library/Ruby/Site - RUBYGEMS PLATFORMS: - ruby - universal-darwin-16 - GEM PATHS: - /Library/Ruby/Gems/2.3.0 - /Users/toto/.gem/ruby/2.3.0 - /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/gems/2.3.0 - GEM CONFIGURATION: - :update_sources => true - :verbose => true - :backtrace => false - :bulk_threshold => 1000 - REMOTE SOURCES: - https://rubygems.org/ - SHELL PATH: - /Users/cminotti/.npm-global/bin - /usr/local/bin - /usr/bin - /bin - /usr/sbin - /sbin我试过brew install ruby

Warning: Bottle installation failed: building from source. ==> Downloading https://www.openssl.org/source/openssl-1.0.2p.tar.gz Already downloaded: /Users/cminotti/Library/Caches/Homebrew/downloads/6d2f0aa30538560efe2aae756229a9ced40e636a70083696fb1bceb6c1a7564c--openssl-1.0.2p.tar.gz /usr/local/Homebrew/Library/Homebrew/utils/fork.rb:49:in Warning: Bottle installation failed: building from source. ==> Downloading https://www.openssl.org/source/openssl-1.0.2p.tar.gz Already downloaded: /Users/cminotti/Library/Caches/Homebrew/downloads/6d2f0aa30538560efe2aae756229a9ced40e636a70083696fb1bceb6c1a7564c--openssl-1.0.2p.tar.gz /usr/local/Homebrew/Library/Homebrew/utils/fork.rb:49:in write':来自/ usr / local / Homebrew / Library / Homebrew / utils / fork的管道损坏(Errno :: EPIPE)。 rb:49:从/ usr / local / Homebrew / Library / Homebrew / utils / fork放入.rb:49: puts' from /usr/local/Homebrew/Library/Homebrew/utils/fork.rb:49:in safe / fork的块(3级)救援(来自/ usr / local / Homebrew / Library / Homebrew / utils / fork.rb:31:位于block (3 levels) in safe_fork' from /usr/local/Homebrew/Library/Homebrew/utils/fork.rb:30:in fork'来自/ usr / local / Homebrew / Library / Homebrew / utils / fork.rb:30:在block (2 levels) in safe_fork' from /usr/local/Homebrew/Library/Homebrew/utils/fork.rb:27:in来自/ usr / local / Homebrew /的block (2 levels) in safe_fork' from /usr/local/Homebrew/Library/Homebrew/utils/fork.rb:27:in中的block (2 levels) in safe_fork' from /usr/local/Homebrew/Library/Homebrew/utils/fork.rb:27:in库/Homebrew/utils/fork.rb:27: block in safe_fork' from /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.7/lib/ruby/2.3.0/tmpdir.rb:89:in mktmpd中 ir'来自/usr/local/Homebrew/Library/Homebrew/utils/fork.rb:26:在safe_fork' from /usr/local/Homebrew/Library/Homebrew/formula_installer.rb:719:in build'来自/ usr /本地/Homebrew/Library/Homebrew/formula_installer.rb:311:在install' from /usr/local/Homebrew/Library/Homebrew/formula_installer.rb:572:in :在install_dependency中/ usr / local / Homebrew / Library / Homebrew / Formula_installer.rb:534:在block in install_dependencies' from /usr/local/Homebrew/Library/Homebrew/formula_installer.rb:534:in :在block in install_dependencies' from /usr/local/Homebrew/Library/Homebrew/formula_installer.rb:534:in每个中:在install_dependencies' from /usr/local/Homebrew/Library/Homebrew/formula_installer.rb:251:in中的install_dependencies' from /usr/local/Homebrew/Library/Homebrew/formula_installer.rb:251:ininstall_formula' from /usr/local/Homebrew/Library/Homebrew/cmd/install.rb:253:in在/usr/local/Homebrew/Library/Homebrew/cmd/install.rb:251:安装在块中each' from /usr/local/Homebrew/Library/Homebrew/cmd/install.rb:251:in install'来自/ usr / local / Homebre w / Library / Homebrew / brew.rb:89:in <main>' Error: An exception occured within a build process: Errno::EACCES: Permission denied @ dir_s_mkdir - /usr/local/Cellar/openssl/1.0.2p /usr/local/Cellar/openssl/1.0.2p

我继续研究,这就是我所做的:brew更新:

touch: /usr/local/Homebrew/.git/FETCH_HEAD: Permission denied error: cannot open .git/FETCH_HEAD: Permission denied /usr/local/Homebrew/Library/Homebrew/cmd/update.sh: line 527: /usr/local/Homebrew/.git/UPDATE_FAILED: Permission denied touch: /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/.git/FETCH_HEAD: Permission denied error: cannot open .git/FETCH_HEAD: Permission denied /usr/local/Homebrew/Library/Homebrew/cmd/update.sh: line 527: /usr/local/Homebrew/.git/UPDATE_FAILED: Permission denied touch: /usr/local/Homebrew/Library/Taps/homebrew/homebrew-php/.git/FETCH_HEAD: Permission denied error: cannot open .git/FETCH_HEAD: Permission denied /usr/local/Homebrew/Library/Homebrew/cmd/update.sh: line 527: /usr/local/Homebrew/.git/UPDATE_FAILED: Permission denied fatal: Unable to create '/usr/local/Homebrew/.git/index.lock': Permission denied fatal: Unable to create '/usr/local/Homebrew/.git/index.lock': Permission denied Cannot save the current index state Error: Could not 'git stash' in /usr/local/Homebrew! Please stash/commit manually if you need to keep your changes or, if not, run: cd /usr/local/Homebrew git reset --hard origin/master cd /usr/local/Homebrew git reset --hard origin/master fatal: Unable to create '/usr/local/Homebrew/.git/index.lock': Permission denied

无论如何,如果有人有一个主意,我就会有些困惑,我是接受者!

指南针是否安装在该路径上? 请尝试一下。

sudo gem install -n /usr/local/bin compass

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM