“npm 安装"在 node_modules 目录中安装所有依赖项,而不是将它们嵌套 [英] "npm install" installs all dependencies in node_modules directory, instead of having them nested

查看:41
本文介绍了“npm 安装"在 node_modules 目录中安装所有依赖项,而不是将它们嵌套的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要知道以下行为是否正常.

I need to know if the following behavior is normal.

当我 npm install 时,我的 package.json 和依赖项中的每个包都不再安装嵌套,但是每个依赖项安装在 node_modules 目录中.这使得我的 node_modules 目录看起来像这样:

When I npm install, each package from my package.json and the dependencies, don't get installed nested anymore, but each dependency is installed in the node_modules directory. That makes my node_modules directory blown and look like this:

这是因为我更新了 npm 和 node.

This happened since I updated npm and node.

现在我跑:

npm -v 3.3.6
node -v 4.2.1
python 2.7
windows 7
wamp

我的 package.json 文件如下所示:

My package.json file looks like this:

{
  "private": true,
  "devDependencies": {
    "gulp": "^3.8.8"
  },
  "dependencies": {
    "laravel-elixir": "^3.0.0",
    "bootstrap-sass": "^3.0.0"
  }
}

这是标准的 Laravel package.json 文件.

It's the standard laravel package.json file.

有没有办法再次嵌套目录,因为我不喜欢这种有100多个子目录的文章.

Is there a way to have nested directories again, because I don't like such a blown article with over 100 sub directories.

推荐答案

这是 npm 3new 行为,按照 这个 npm 博客.

That's the new behavior of npm 3 as per this npm blog.

这篇关于“npm 安装"在 node_modules 目录中安装所有依赖项,而不是将它们嵌套的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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