typings vs @types NPM scope

@types is the new way to install the definitions in typescript 2.0. It unifies the management of definitions and packages. So that you do not need multiple tools and config files. Only going to need npm and package.json instead of having to have npm, package.json, typings, typings.json. It basically makes installing and managing definitions easier … Read more

Using Async waterfall in node.js

First identify the steps and write them as asynchronous functions (taking a callback argument) read the file function readFile(readFileCallback) { fs.readFile(‘stocktest.json’, function (error, file) { if (error) { readFileCallback(error); } else { readFileCallback(null, file); } }); } process the file (I removed most of the console.log in the examples) function processFile(file, processFileCallback) { var stocksJson … Read more

What does — do when running an npm command?

— as an argument on its own is standardized across all UNIX commands: It means that further arguments should be treated as positional arguments, not options. See Guideline 10 in POSIX Utility Syntax Conventions. To give you a non-NPM-based example, ls — -l will look for a file named -l, because the — specified that … Read more

npm update check failed

Following is the answer from github Fix for windows, I got this message : npm update check failed Try running with sudo or get access to the local update config store via sudo chown -R $USER:$(id -gn $USER) C:\Users.config so I went on to C:\Users.config and deleted the “configstore” folder. once I done this, next … Read more

npm doesn’t work, get always this error -> Error: Cannot find module ‘are-we-there-yet’

You have broken npm by removing some of its dependencies. are-we-there-yet is a dependency of npmlog which is a dependency of npm itself, and you somehow deleted it. The usual simple solution for such cases is reinstalling a package, but that doesn’t work if npm cannot operate. Fortunately, npm tarball comes prebundled with dependencies and … Read more