【发布时间】:2020-04-25 02:06:11
【问题描述】:
我正在努力从我的终端(本地在我的项目文件夹中)安装 ESLint。
我正在运行这个命令:
sudo npm install eslint --save-dev
但是,返回带有代码 ENOSELF 的 npm 错误,并带有以下消息
npm ERR! code ENOSELF
npm ERR! Refusing to install package with name "eslint" under a package
npm ERR! also called "eslint". 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! /Users/[username]/.npm/_logs/2020-01-07T14_32_27_111Z-debug.log
我没有名为 eslint 的文件夹或文件或任何远程接近的文件。在我的项目目录中,我有一组用 VSCode 编辑过的 html、js 和 csv 文件。
我真的很困惑为什么会发生这个错误,希望能得到帮助。
【问题讨论】:
标签: npm terminal npm-install eslint eslintrc