Fixing: NPM / Node error on Windows: The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.

I was using Visual Studio 2015 update 3 on Windows 10 x64 and was getting the error: “The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.”, when running …

How to fix: ENOENT: no such file or directory, rename … \abbrev (angular cli)

When I was running “npm install -g angular-cli”, I was getting the following error: npm ERR! npm  v3.10.3                                                  npm ERR! path C:\Users\Roel\AppData\Roaming\npm\node_modules\.staging\a bbrev-69492d5e                                                         npm ERR! code ENOENT                                                   npm ERR! errno -4058                                                   npm ERR! syscall rename                                                npm ERR! enoent ENOENT: no such file or directory, rename ‘C:\Users\Roe l\AppData\Roaming\npm\node_modules\.staging\abbrev-69492d5e’ -> ‘C:\Use rs\Roel\AppData\Roaming\npm\node_modules\angular-cli\node_modules\ember …

Caculate trendline datapoints in TypeScript

If you want to calculate trendline datapoints in TypeScript, you can use the following code:       Code   module helpers.math { ‘use strict’; /** * Based off: https://github.com/Tom-Alexander/regression-js/blob/master/src/regression.js * @param known_y – Array of numbers representing the y-axis values, [1, 2, …]. * @param known_x – Optional array …