我装webpack的时候也出现了这个问题 Refusing to install webpack as a dependency of itself 当时我的package.json是这个样子的 { "name": "webpack", "version": "1.0.0", "description": "", "main": "index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, "keywords": [], "author": "", "license": "ISC", "devDependencies": { } } 然后我把name字段改成webpacktest就好了,没错!就好了,太神奇了 { "name": "webpacktest", "version": "1.0.0", "description": "", "main": "index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, "keywords": [], "author": "", "license": "ISC", "devDependencies": { "gulp": "^3.9.1", "webpack": "^1.13.0" } }
我装webpack的时候也出现了这个问题
当时我的package.json是这个样子的
然后我把name字段改成webpacktest就好了,没错!就好了,太神奇了