Press "Enter" to skip to content

局部安装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!     

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/rgg/.npm/_logs/2019-06-24T03_11_00_049Z-debug.log

执行命令的目录里有一个package.json文件,并且该文件里的name字段就叫webpack

换个名字就好了

Leave a Reply

Your email address will not be published. Required fields are marked *