简体   繁体   中英

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

I get an error when I want to compile with gulp

events js: 136

I tried several modifications by recovering a node_module folder that works

I can't find a solution. Could you help me?

 (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 : 

here is the content of the log file!!! `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.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 -g -Os -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 " 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 */ I'll check the compass doc to see if it's coming from there! thank you in advance for your help. so I tried to install compass with the command:

gem update --system and here is the answer:

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. I still tried the other order to see! Code :
gem install compass : 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.

so I tried several things here:

xcode-select --install xcode-select: error: command line tools are already installed, use "Software Update" to install updates

xcode-select -v xcode-select version 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 I tried 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': Broken pipe (Errno::EPIPE) from /usr/local/Homebrew/Library/Homebrew/utils/fork.rb:49:in puts' from /usr/local/Homebrew/Library/Homebrew/utils/fork.rb:49:in rescue in block (3 levels) in safe_fork' from /usr/local/Homebrew/Library/Homebrew/utils/fork.rb:31:in block (3 levels) in safe_fork' from /usr/local/Homebrew/Library/Homebrew/utils/fork.rb:30:in fork' from /usr/local/Homebrew/Library/Homebrew/utils/fork.rb:30:in block (2 levels) in safe_fork' from /usr/local/Homebrew/Library/Homebrew/utils/fork.rb:27:in open' from /usr/local/Homebrew/Library/Homebrew/utils/fork.rb:27:in 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' from /usr/local/Homebrew/Library/Homebrew/utils/fork.rb:26:in safe_fork' from /usr/local/Homebrew/Library/Homebrew/formula_installer.rb:719:in build' from /usr/local/Homebrew/Library/Homebrew/formula_installer.rb:311:in install' from /usr/local/Homebrew/Library/Homebrew/formula_installer.rb:572:in install_dependency' 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 each' 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' from /usr/local/Homebrew/Library/Homebrew/cmd/install.rb:321:in install_formula' from /usr/local/Homebrew/Library/Homebrew/cmd/install.rb:253:in block in install' from /usr/local/Homebrew/Library/Homebrew/cmd/install.rb:251:in each' from /usr/local/Homebrew/Library/Homebrew/cmd/install.rb:251:in install' from /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

I continued my research, that's what I did: brew update :

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

Anyway, I'm a little stuck if anyone has an idea, I'm a taker!

Is compass installed at that path? Please try with that.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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