npm install sequelize -D npm ERR! code ENOSELF npm ERR! Refusing to install package with name “sequ

事情是这样的,今天早上打算使用 sequelize ,操作 mysql 数据库,安装 sequelize 的时候开始报错了。我以为是自己的名称写错了。但是我上 npm 上面寻找安装方法,结果复制粘贴上的也没有用。
PS D:\nodejs\sequelize> npm install sequelize -D
npm ERR! code ENOSELF
npm ERR! Refusing to install package with name "sequelize" under a package
npm ERR! also called "sequelize". 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\DELL\AppData\Roaming\npm-cache\_logs\2020-07-26T00_45_34_414Z-debug.log
PS D:\nodejs\sequelize>
后来仔细一看报错,不是名称的问题,是我文件夹的名称与 sequelize 重复了。改一个名字就好了。
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
引用: 在使用npm安装插件时,如果遇到类似的错误消息:"npm ERR! code ERESOLVE npm ERR! ERESOLVE could not resolve",可能是由于依赖解析问题导致的。引用中提到了两种解决方案。 第一种解决方案是通过配置npm来解决该问题。可以运行以下命令来设置npm的配置:npm config set legacy-peer-deps true。这将把npm的配置项"legacy-peer-deps"设置为true,从而启用旧版依赖对等性解决方案。然后可以继续执行npm安装插件的操作,例如运行npm install axios。 第二种解决方案是在安装插件的命令后面加上参数--legacy-peer-deps。例如,可以运行npm install axios --legacy-peer-deps。这样可以在安装插件时使用旧版依赖对等性解决方案。 以上是针对全局的解决方案,可以根据个人需求选择适合的方法。希望这些解决方案对你有所帮助。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* [$ npm install -g truffle npm ERR! code EEXIST错误解决方法](https://download.csdn.net/download/weixin_38629449/14040289)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"] - *2* [安装依赖时报错npm ERR!... ERESOLVE could not resolve npm ERR! npm ERR! While resolving](https://blog.csdn.net/yh_31/article/details/127440247)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"] - *3* [npm ERR! code ERESOLVE npm ERR! ERESOLVE could not resolve](https://blog.csdn.net/chenZH0975/article/details/126744697)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值