是否可以通过npm init -y在终端中确定软件包名称?

时间:2019-07-10 19:29:32

标签: npm npm-init

我已经构建了一个脚本来设置带有分支和启动配置文件的存储库(在本地和GitHub上)。缺少的一件事是,当名称中包含空格时,可以在新目录中自动初始化package.json的功能。

我实际上想更好地理解npm init,所以与其将我必须重命名为“ Firebase-practice”(有效)的“ Firebase实践”目录重命名,我要看看是否可以为其命名使用-y命令。也许是在文档中,我只是不理解。

我尝试过的事情:我有一个名为“ Firebase练习”的目录。我尝试使用npm init -ynpm init --force -y,它说,"Invalid name: 'Firebase practice"我也尝试过npm init firebase-practice -y,它给了我...

npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/create-firebase-practice - Not found
npm ERR! 404
npm ERR! 404  'create-firebase-practice@latest' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

npm ERR! A complete log of this run can be found in:

我期望:npm init -y用连字符替换目录中的空格。

我得到了:一个带有空格的软件包名称和一个“无效名称”错误。

是否可以使用npm init [package-name] -y之类的方式指定包名称?

0 个答案:

没有答案