Question: why npm init is used?
Answer: npm-init create a package. json file npm init <initializer> can be used to set up a new or existing npm package. initializer in this case is an npm package named create-<initializer> , which will be installed by npx , and then have its main bin executed – presumably creating or updating package.