5 lines
16 KiB
JSON
5 lines
16 KiB
JSON
|
{
|
||
|
"id": "guide/npm-packages",
|
||
|
"title": "Workspace npm dependencies",
|
||
|
"contents": "\n\n\n<div class=\"github-links\">\n <a href=\"https://github.com/angular/angular/edit/master/aio/content/guide/npm-packages.md?message=docs%3A%20describe%20your%20change...\" aria-label=\"Suggest Edits\" title=\"Suggest Edits\"><i class=\"material-icons\" aria-hidden=\"true\" role=\"img\">mode_edit</i></a>\n</div>\n\n\n<div class=\"content\">\n <h1 id=\"workspace-npm-dependencies\">Workspace npm dependencies<a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"guide/npm-packages#workspace-npm-dependencies\"><i class=\"material-icons\">link</i></a></h1>\n<p>The Angular Framework, Angular CLI, and components used by Angular applications are packaged as <a href=\"https://docs.npmjs.com/getting-started/what-is-npm\" title=\"What is npm?\">npm packages</a> and distributed via the <a href=\"https://docs.npmjs.com/\">npm registry</a>.</p>\n<p>You can download and install these npm packages by using the <a href=\"https://docs.npmjs.com/cli/install\">npm CLI client</a>, which is installed with and runs as a <a href=\"https://nodejs.org\" title=\"Nodejs.org\">Node.js®</a> application. By default, the Angular CLI uses the npm client.</p>\n<p>Alternatively, you can use the <a href=\"https://yarnpkg.com/\">yarn client</a> for downloading and installing npm packages.</p>\n<div class=\"alert is-helpful\">\n<p>See <a href=\"guide/setup-local\" title=\"Setting up for Local Development\">Local Environment Setup</a> for information about the required versions and installation of <code>Node.js</code> and <code>npm</code>.</p>\n<p>If you already have projects running on your machine that use other versions of Node.js and npm, consider using <a href=\"https://github.com/creationix/nvm\">nvm</a> to manage the multiple versions of Node.js and npm.</p>\n</div>\n<h2 id=\"packagejson\"><code>package.json</code><a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"guide/npm-packages#packagejson\"><i class=\"material-icons\">link</i></a></h2>\n<p>Both <code>npm</code> and <code>yarn</code> install the packages that are identified in a <a href=\"https://docs.npmjs.com/files/package.json\"><code>package.json</code></a> file.</p>\n<p>The CLI command <code>ng new</code> creates a <code>package.json</code> file when it creates the new workspace.\nThis <code>package.json</code> is used by all projects in the workspace, including the initial app project that is created by the CLI when it creates the workspace.</p>\n<p>Initially, this <code>package.json</code> includes <em>a starter set of packages</em>, some of which are required by Angular and others that support common application scenarios.\nYou add packages to <code>package.json</code> as your application evolves.\nYou may even remove some.</p>\n<p>The <code>package.json</code> is organized into two groups of packages:</p>\n<ul>\n<li><a href=\"guide/npm-packages#dependencies\">Dependencies</a> are essential to <em>running</em> applications.</li>\n<li><a href=\"guide/npm-packages#dev-dependencies\">DevDependencies</a> are only necessary to <em>develop</em> applications.</li>\n</ul>\n<div class=\"alert is-helpful\">\n<p><strong>Library developers:</strong> By default, the CLI command <a href=\"cli/generate\"><code>ng generate library</code></a> creates a <code>package.json</code> for the new library. That <code>package.json</code> is used when publishing the library to npm.\nFor more information, see the CLI wiki page <a href=\"https://github.com/angular/angular-cli/wiki/stories-create-library\">Library Support</a>.</p>\n</div>\n<a id=\"dependencies\"></a>\n<h2 id=\"dependencies\">Dependencies<a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"guide/npm-packages#dependencies\"><i class=\"material-icons\">link</i></a></h2>\n<p>The packages listed in the <code>dependencies</code> section of <code>package.json</code> are essential to <em>running</em> applications.</p>\n<p>The <code>dependencies</code> section of <code>package.json</code> contains:</p>\n<ul>\n<li>\n<p><a href=\"guide/npm-packages#a
|
||
|
}
|