本文介绍了为npm使用与“ package.json”不同的文件名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以通过命令行告诉npm使用与 package.json不同的文件?

Is there a way to tell npm from the command line to use a different file than "package.json"?

编辑:

谢谢您的回答。我已经检查过文档,并希望有解决方法或未记录的方式来实现。

Thank you for your answers. I already checked the docs and hoped there was a workaround or a non-documented way to achieve that. I'll think of something else then.

推荐答案

不。如,这是您可以使用的唯一语法:

Nope. As described in the npm-install docs, this is the only syntaxes you can use :

npm install (with no args in a package dir)
npm install <tarball file>
npm install <tarball url>
npm install <folder>
npm install [@<scope>/]<name> [--save|--save-dev|--save-optional] [--save-exact]
npm install [@<scope>/]<name>@<tag>
npm install [@<scope>/]<name>@<version>
npm install [@<scope>/]<name>@<version range>
npm i (with any of the previous argument usage)

不带参数的命令将安装包含package.json文件描述的程序的文件夹

With no args, the command will install a folder containing a program described by a package.json file.

这篇关于为npm使用与“ package.json”不同的文件名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-19 10:57