Wednesday, July 26, 2017

Library not loaded: /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib (LoadError)

I had grunt process defined to compile the sass files, it was working fine until I had to reinstall my brew and it end up breaking the sass compile compass. Below was the setting -

 compass: {
                options: {
                    cssDir: 'static/css',
                    raw: 'Sass::Script::Number.precision = 10\n::Encoding.default_external = \'utf-8\'\n',
                    sourcemap: true
                styleSass: {
                    options: {
                        sassDir: '<%= appConfig.src.sass %>',
                        specify: ['<%= appConfig.src.sass %>/demo.sass', '<%= appConfig.src.sass %>/style.sass']

On running the grunt, it failed with following error -

Running "compass:styleSass" (compass) task
Warning: Command failed: /bin/sh -c compass --version
/Users/J/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:126:in `require': dlopen(/Users/J/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/x86_64-darwin14.1.0/digest/sha1.bundle, 9): Library not loaded: /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib (LoadError)
  Referenced from: /Users/J/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/x86_64-darwin14.1.0/digest/sha1.bundle
  Reason: image not found - /Users/J/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/x86_64-darwin14.1.0/digest/sha1.bundle
from /Users/J/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:126:i

if you run into an issue, do the following to fix it -

$ brew remove openssl
$ brew install openssl

$ brew reinstall openssl

It should fix it!

Tuesday, July 25, 2017

Cannot read property 'localeCompare' of undefined

While running npm install, I ran into following error -

npm WARN engine webpack@2.7.0: wanted: {"node":">=4.3.0 =5.10"} (current: {"node":"5.0.0","npm":"3.3.6"})
npm ERR! Darwin 16.6.0
npm ERR! argv "/Users/J/.nvm/versions/node/v5.0.0/bin/node" "/Users/J/.nvm/versions/node/v5.0.0/bin/npm" "install"
npm ERR! node v5.0.0
npm ERR! npm v3.3.6

npm ERR! Cannot read property 'localeCompare' of undefined
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR!
npm ERR! Please include the following file with any support request:
npm ERR! /Users/Jaimin/Apps/redesign/data-exploration/npm-debug.log

mostly you will run into this issue if you are running npm 3.3.5 or 3.3.6.

You can try resolve it by below two ways,

1. Remove all node_modules folder, and try to run 'npm install' again.

If above doesn't resolve it, try below -

2. upgrade npm to 3.3.7 (or any subsequent one)
npm install npm@3.3.7 -g

It should resolve the issue. If you want to read up various other suggestions/reasoning checkout here