FIX – Windows NPM Node-gyp error for various NPM modules

If you’ve ever tried to install an NPM module like Xml2Js and received these pretty little errors followed by a failure to install Xml2Js (or any NPM module that requires node-gyp), there’s no need to go nuts and install all the dependencies yourself or configure system variables. Just for reference, here’s what your node-gyp errors will look like:

gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
gyp ERR! stack at failNoPython (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:449:14)
gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:404:11
gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\graceful-fs\polyfills.js:284:29

Luckily, Node-gyp made this much easier, see docs here: https://github.com/nodejs/node-gyp

From your command line, run:

npm install --global --production windows-build-tools

then run

npm install --global node-gyp

Go ahead and install your desired package again and you should be good to go.

Special thanks to Dawid on StackOverflow for saving me hours of pain: http://stackoverflow.com/a/21366601/2121455

 

Find value in cell from list of values (does cell contain anything in this list) – Google Docs

named range google docs sheets

One of the most useful formulas for me was being able to find if a cell contained a value from a list of items, this excellent Excel formula https://exceljet.net/formula/cell-contains-one-of-many-things was exactly what I needed.

The formula: =SUMPRODUCT(–ISNUMBER(SEARCH(things,A1)))>0 also works in Google docs, provided that you created a named range.

Here is the spreadsheet for you to look at:

Feel free to poke around the spreadsheet too! 

Important note: I also included an example of where my named range contained a blank cell, don’t do this – if you do this, the entire formula falls apart and you’ll get bad values.

To create a named range in Google docs, simply highlight your cells and click on the Data menu bar and select Named Ranges:

named range google docs sheets

Then name it appropriately:

named_range_name

How to download all attachments from a gmail thread

You may have several attachments within a Gmail email thread, but it’s too time consuming to download one attachment at a time. There’s a Forward All option in the top nav menu that allows you to forward the thread back to yourself, thus allowing you to conveniently download all attachments in a gmail thread.  See instructions and credit below:

Step 1: Open the email thread with attachments

how to forward all gmail and download attachments

Step 2: Click on the top menu and select “Forward All” and forward it to yourself

how to forward all gmail and download attachments

Step 3: Open the forwarded email and at the bottom, you should have an option to Download all

how to forward all gmail and download attachments

Credit to  HansBKK: http://productforums.google.com/forum/#!topic/gmail/NPGn1YYgL8o