尝试将 npm bootstrap 安装到我的项目时,我可能遗漏了什么?

What may I be missing while trying to install npm bootstrap to my project?

我正在尝试使用 npm 在我的项目上安装 bootstrap。我已经

npm init and confirmed package.json is on the associated folder. However, npm install bootstrap keeps bringing a dependency error npm ERR! code ENOSELF npm ERR! Refusing to install package with name "bootstrap" under a package npm ERR! also called "bootstrap". Did you name your project the same
npm ERR! as the dependency you're installing? npm ERR! npm ERR! For more information, see: npm ERR! https://docs.npmjs.com/cli/install#limitations-of-npms-install-algorithm

npm 错误!此 运行 的完整日志可在以下位置找到: 错误! C:\Users\USER\AppData\Roaming\npm-cache_logs21-07-30T11_18_57_954Z-debug.log

请问如何解决这个错误?


您可能将您的包命名为 bootstrap,这会阻止 npm 从注册表中安装具有 相同 名称的包。 尝试在 package.json:

中将您的包裹重命名为 bootstrap-test
{
  "name": "bootstrap-test",
  "version": "0.1.0",
  "description": "My first bootstrap project!"
}