filmov
tv
Create package.json using npm init | Nodejs full course

Показать описание
Creating a package. json file is typically the first step in a Node project, and you need one to install dependencies in npm.
...
Create package. json
Enter the root folder of your project.
Run npm init.
Fill out the prompts to create your package. json.
In this tutorial, we will create and publish to the NPM registry, an NPM package using the following steps.
Create an NPM registry account.
Write some code that will become your NPM package.
Test this locally.
Add module. ...
Publish your package to the NPM registry.
Test your NPM package by using npm install.
Description. This command installs a package and any packages that it depends on. If the package has a package-lock, or an npm shrinkwrap file, or a yarn lock file, the installation of dependencies will be driven by that, respecting the following order of precedence: npm-shrinkwrap. json.
The package. json file is normally located at the root directory of a Node. js project. The name field should explain itself: this is the name of your project.
create a package. json file with values that you supply, use the npm init command. On the command line, navigate to the root directory of your package. Answer the questions in the command line questionnaire.
Create a package. json file
To create a package. json file, on the command line, in the root directory of your Node. js module, run npm init : ...
Provide responses for the required fields ( name and version ), as well as the main field:
name : The name of your module. version : The initial module version.
Комментарии