Returning a value from a node child process
One can execute Linux, git shell commands from node script using node’s child process API like exec, execSync. But when you want to save the return value outside of the function scope, one must...
@ tutorialhorizon
One can execute Linux, git shell commands from node script using node’s child process API like exec, execSync. But when you want to save the return value outside of the function scope, one must...
Have you received below error while doing npm install? npm install npm notice created a lockfile as package-lock.json. You should commit this file. npm WARN Invalid name: Foo Bar Solution: In your package.json, “name”...
Have you received below error while doing yarn install? yarn install v1.5.1 error An unexpected error occurred: “package.json: Name contains illegal characters”. info If you think this is a bug, please open a bug...
Nodejs allows us to execute linux commands from its child process module as shown below. var exec = require(‘child_process’).exec; // any unix based command var cmdToLaunch = “ls -la”; function execCB (error, stdout, stderr)...
Below shell script is running a node script, which gets an object from package.json, updates the app version and writes it back to the package.json using node API. // foo.sh node <<EOF var fs...
If you are fed up of having to set the default nodejs version in each terminal tab, then this post is for you. Hopefully you installed node using nvm. Use the following command to...
For some strange reason, I started getting this error on my ubuntu server, even though everything was working perfectly before. The following command resolved the issue
If you’re using gulp or similar build tools to build your project you might run into this issue. /Users/username/Library/Developer/Xcode/DerivedData/project/filename.sh: line 4: gulp: command not found Here, xCode can not find gulp because it uses...
If you’re using grunt or similar build tools to build your project you might run into this issue. /Users/username/Library/Developer/Xcode/DerivedData/project/filename.sh: line 4: grunt: command not found Here, xCode can not find grunt because it uses...
Recent Comments