npm install webpack --save-dev为什么出错

时间:2024-04-05 19:46:45

下载webpack时候出错是什么原因

错误是这样的

PS F:\web-lcm\webpack> npm install webpack --save --dev
npm WARN install Usage of the --dev option is deprecated. Use --only=dev instead.
npm ERR! code ENOSELF
npm ERR! Refusing to install package with name “webpack” under a package
npm ERR! also called “webpack”. 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\nicole\AppData\Roaming\npm-cache_logs\2020-05-09T07_54_24_533Z-debug.log
PS F:\web-lcm\webpack> npm install webpack --save-dev
npm ERR! code ENOSELF
npm ERR! Refusing to install package with name “webpack” under a package
npm ERR! also called “webpack”. 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 install webpack --save-dev为什么出错

错误的原因是这样的

npm init:package name: (webpack)
不知道你注意到了木,我用了啥,我用了webpack这个名称,在这倒是没有报错啥的,接下来就惨了
换个名称就好了啦,嘻嘻,不能叫webpack哦!!!