npm 创建了大量文件,我做错了什么?

npm creates huge number of files, what am I doing wrong?

我阅读的方式this section of the PhpStorm manual,添加开发工具我可以这样做:

If a tool is a documentation or a test framework, which are of no need for those who are going to re-use your application, it is helpful to have it excluded from download for the future. This is done by marking the tool as a development dependency, which actually means adding the tool in the devDependencies section of the package.json file.

With PhpStorm, you can have a tool marked as a development dependency right during installation. Do one of the following:

Switch to the project root folder and type the following command at the command line prompt: npm install --dev <tool name>

[...]

这个好像不对或者我理解错了,因为当我运行

npm install --dev del

为了得到一个可以在开发过程中删除文件以清除缓存的工具,npm 创建了一个深度嵌套的文件夹结构,其大小为数 GB,包含数百万个文件。我杀了它,然后花了半个小时将更深的文件夹在树中进一步向上移动,以便路径足够短 Windows 可以删除它们。

我做错了什么?

顺便说一下,将它添加到 package.json -> devDependencies 和 运行 npm install 工作正常。

节点 0.12.0,npm 2.5.1

已知错误,https://github.com/npm/npm/issues/5554. This flag will be removed soon - see https://github.com/npm/npm/issues/6200。我建议改用 npm install --save-dev - 但您需要先创建一个 package.json。在 PHPStorm 中,这可以使用 File | New | package.json

来完成