Workaround for eternal problem with node-gyp on Windows

This is super annoying. Reliance on node-gyp on Windows is such a pain! The error description says the it can not find the Python executable, even though it is there. There is a workaround Open cmd as Administrator (Otherwise the installation fails, meh) run command npm install –global –production windows-build-tools This will install Visual Studio Build Tools (yes, I know, there is mismatch in names) This will also install Python again as a side-effect (meh) run npm rebuild in the project’s folder re-open cmd and run npm install all should be fine now

Continue Reading

Convert exponential numbers to decimal form in Javascript

As almost every developers knows, Javascript has notorious problems when working with really big or really small decimal numbers. The reason is floating point. Purpose of this article is not to explain why it behaves the way it does, there are much better resources dedicated just for that. You can read the explanation here or here. There are also various libraries dedicated to working with decimals and precise calculations, such as big.js. To ilustrate the problem, see the short video below. The input shows the text value, and on the right there is raw value as represented in Javascript. The issue it …

Continue Reading