I am trying to use the jsonfile package in my project, but I get the following errors:
Refusing to install package with name <packagename> under a package also called <packagename>.
(Note that none of the directory or filename is same as package name)
Cannot find module <packagename>.
The problem is caused when the name of project in package.json
is the same as the module you're trying to install.
To solve this problem, please change the project name in package.json
to something else. For example, "jsonfile-test":
{
"name": "jsonfile-test",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With