my package can't install

(Gihan Rangana) #1

I create a package named react-mui-datatables. I can’t install that using npm install --save react-mui-datatables. this error occurred,

npm ERR! code ENOSELF
npm ERR! Refusing to install package with name "react-mui-datatables" under a package
npm ERR! also called "react-mui-datatables". 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!     C:\Users\Gihan\AppData\Roaming\npm-cache\_logs\2018-08-12T08_17_18_024Z-debug.log

how can I fix that error? please help me

(Markus Tacker) #2

You are running this command inside a folder which has a package.json. This file has a name property which is also react-mui-datatables. You need to change the name. It cannot be the same as the package you are trying to install.

(Gihan Rangana) #3

i tried but its not working

(Markus Tacker) #4

Hei, have you tried it with a new project?

mkdir my-project
cd my-project
npm init -y
npm i --save react-mui-datatables

(Gihan Rangana) #5

can you import MuiDataTable? i can’t this error occurred. why? i create a new i can install.but can’t import.

i have this in local its working but npm installed version gives this error

Module not found: `D:\My Projects\React\Libraries\Datatable\example-table\node_modules\react-mui-datatables\lib\MUIDataTable.js` does not match the corresponding path on disk `MuiDataTable.js`.

(Markus Tacker) #6

No. The problem is that the "main" section in the package.json of react-mui-datatables points to index.js, but in the archive it is located in lib/index.js.

(system) #7

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.