Tag: npm
-
How to use npm Chalk package to style terminal string?
Chalk is a public npm package which can be used to style terminal string.
-
How to include core modules in you Node.js application ?
Node.js core modules such as fs(file system) , http, url etc… has to be imported into the program file using the require key word.
-
What is unsafe-perm flag in npm?
Unsafe-perm flag is set to true to suppress the UID/GID (User Identifier/ Group Identifier) switching when running package scripts.The flag is explicitly set to false to prevent non-root user from installing packages. If EACCESS error occurs while installing Electron, then running the installation through sudo and the unsafe-perm flag set to true will install the package.
-
EACCESS error in Electron installation
When we try to install Electron using npm in terminal(mac OS), it may throw EACCESS error due to some mismatch in npm permissions. Use sudo to install the package.If error throws up again even after using sudo, then the unsafe-perm flag need to be set to true.
-
Downgrade npm: command line
Many nodejs apps like create–react–native–app are designed to work over npm 4 and many of those remain un-ported to latest npm versions. In such cases we would be needing to downgrade a working npm version that might be higher than the npm versions they work for. In this respect, create–react–native–app works only with 4 or lesser and […]
-
Manage data with multiple child processes in NodeJS
There are some scenarios, where we would like to have multiple system processes spawned as child processes from nodeJs. For Instance, if we wanted to do a batch download of resources from some other server etc. The gist link contains one such example. The simplest way to identify and get result back from each individual spawned processes […]
-
Using env variables in NodeJS
You can set and use environment variables within NodeJS processes as below: Windows: Unix: and inside your app javascript you can check across this as