npm install 使用官方 Angular2 快速入门教程创建 267 个子文件夹 [英] npm install Creates 267 sub-folders with the Official Angular2 Quickstart Tutorial

查看:58
本文介绍了npm install 使用官方 Angular2 快速入门教程创建 267 个子文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是 Angular 和 Node 的新手,正在关注官方

这不可能是正确的,是吗?这是 package.json 代码:

<代码>{"name": "angtest","版本": "1.0.0",脚本":{"start": "tsc && 同时\"tsc -w\" \"lite-server\" ","lite": "lite-server","tsc": "tsc","tsc:w": "tsc -w"},许可证":[{类型":麻省理工学院","url": "https://github.com/angular/angular.io/blob/master/LICENSE"}],依赖关系":{"@angular/common": "~2.1.1","@angular/compiler": "~2.1.1","@angular/core": "~2.1.1","@angular/forms": "~2.1.1","@angular/http": "~2.1.1","@angular/platform-b​​rowser": "~2.1.1","@angular/platform-b​​rowser-dynamic": "~2.1.1","@angular/router": "~3.1.1","@angular/upgrade": "~2.1.1","angular-in-memory-web-api": "~0.1.13","core-js": "^2.4.1",反射元数据":^0.1.8","rxjs": "5.0.0-beta.12","systemjs": "0.19.39",zone.js":^0.6.25"},开发依赖":{"@types/core-js": "^0.9.34","@types/node": "^6.0.45","同时": "^3.0.0","lite-server": "^2.2.2",打字稿":^2.0.3"}}

解决方案

TL;DR:没关系.

npm 的构建是为了让您安装的每个模块在 node_modules 下都有自己的文件夹.此外,鼓励您在编写 npm 包时使用其他 npm 包作为依赖项,这些包有自己的依赖项等.因此,很自然地,在安装几乎所有 npm 包时,您都会获得数十个依赖项,它们都有自己的文件夹.

奖励:给这个 阅读.

I am new to Angular and Node and am following along with the official Angular2 documentation.

In Step 1, you are advised to create package.json, tsconfig.json and systemjs.config.js by copying the sample code (which I have done exactly). You are then directed to run npm install from a command propmt that is pointing at the folder where these files are located.

So, I have done this (exactly as instructed) with Node.js v7.0 for Windows and upon completion of the command, my node_modules folder now contains 267 sub folders!

This can't be correct, can it? Here's the package.json code:

{
  "name": "angtest",
  "version": "1.0.0",
  "scripts": {
    "start": "tsc && concurrently \"tsc -w\" \"lite-server\" ",
    "lite": "lite-server",
    "tsc": "tsc",
    "tsc:w": "tsc -w"
  },
  "licenses": [
    {
      "type": "MIT",
      "url": "https://github.com/angular/angular.io/blob/master/LICENSE"
    }
  ],
  "dependencies": {
    "@angular/common": "~2.1.1",
    "@angular/compiler": "~2.1.1",
    "@angular/core": "~2.1.1",
    "@angular/forms": "~2.1.1",
    "@angular/http": "~2.1.1",
    "@angular/platform-browser": "~2.1.1",
    "@angular/platform-browser-dynamic": "~2.1.1",
    "@angular/router": "~3.1.1",
    "@angular/upgrade": "~2.1.1",
    "angular-in-memory-web-api": "~0.1.13",
    "core-js": "^2.4.1",
    "reflect-metadata": "^0.1.8",
    "rxjs": "5.0.0-beta.12",
    "systemjs": "0.19.39",
    "zone.js": "^0.6.25"
  },
  "devDependencies": {
    "@types/core-js": "^0.9.34",
    "@types/node": "^6.0.45",
    "concurrently": "^3.0.0",
    "lite-server": "^2.2.2",
    "typescript": "^2.0.3"
  }
}

解决方案

TL;DR: That's OK.

npm is built so that every module you install gets its own folder under node_modules. Also, you're encouraged to use other npm packages as dependencies when writing an npm package, which have their own dependencies and so on. So, naturally, when installing almost any npm package, you get dozens of dependencies, which all have their own folders.

Bonus: give this a read.

这篇关于npm install 使用官方 Angular2 快速入门教程创建 267 个子文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆