Refusing to install package with name "webpack" under a package

The bottom line is that if the name in package.json is the same as the package you are trying to install, you will get an error.

Terminal


 npm install --save-dev webpack

I got an error.

The details of the error are as follows.

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>

From the part of also called" webpack "・ ・ ・ on the 3rd line of the error, it was found that there is a package name with the same name.

package.json


{
  "name": "webpack",← This is webpack
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "keywords": [],
  "author": "",
  "license": "ISC"
}

You can safely resolve the error by rewriting the name as webpackdemo.

Recommended Posts

Refusing to install package with name "webpack" under a package
Add a local Swift Package to your project with Swift PM
mysql2 fails to install with bundle install
[Rails] How to log in with a name by adding a devise name column
Install the package with npm install / yarn add
[Rails] rails new to create a database with PostgreSQL
Convert a string to a character-by-character array with swift
Error with bundle install after upgrading to Catalina
Transition to a view controller with Swift WebKit
Rip a CD to MP3 with Ubuntu 18.04 LTS
I tried to break a block with java (1)
How to save a file with the specified extension under the directory specified in Java to the list
What to do if you cannot execute with the command "Java package name / class name"