首页 > 解决方案 > What may I be missing while trying to install npm bootstrap to my project?

问题描述

I am trying to use npm to install bootstrap on my project. I have already

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 ERR! A complete log of this run can be found in: npm ERR! C:\Users\USER\AppData\Roaming\npm-cache_logs\2021-07-30T11_18_57_954Z-debug.log

How do I fix this error pls?


标签: node.jsnpmtwitter-bootstrap-3

解决方案


您可能将您的包命名为bootstrap,这可以防止从注册表中npm安装同名的包。尝试将您的包重命名bootstrap-testpackage.json

{
  "name": "bootstrap-test",
  "version": "0.1.0",
  "description": "My first bootstrap project!"
}

推荐阅读