This article was first published on: Lisk Blog - Medium --

You shouldn’t start applications through npm when you have child processes natively supported by Node.js. In this article, we will provide a list of best practices for Node.js applications with a code snippet that outlines the core problem and shows you how to reproduce the issue in 3 steps. In short, we stopped using npm start to run our blockchain’s core and instead opted for using the native node command.

Introduction to npm and its most well-known command ‘npm start’.

Npm is the go-to node package manager when you are working on a JavaScript project. It allows you to install other people’s code packages into your own project so you don’t have to code everything you need from scratch. Npm also became famous because of its industry-wide usage of script commands that can be entered in the shell to start your application. Of course, the most well-known command is npm start that acts as a wrapper for node app.js.

Our challenge: npm runs app.js files as a child process of npm.

However, what ...

This content is synced from the rightful owners. Copyright on text and images belong to the original source. -- This article was first published on: Lisk Blog - Medium

Tagged on: