Interested in v10 released-Let's make a JS desktop application with Electron, I would like to make a desktop application using Electron. I did.
After installing Node.js, when npm install, what to do when such an error message appears.
PS C:\electron> npm install electron
npm ERR! code ENOSELF
npm ERR! Refusing to install package with name "electron" under a package
npm ERR! also called "electron". 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>
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\user\AppData\Roaming\npm-cache\_logs\2020-09-05T13_20_15_582Z-debug.log
The error claimed that the installation could not be performed if the folder name and package name were the same.
In pakege.json, it is " name ":" electron "
, so I think that it can be solved by modifying this.
{
"name": "electron", << "test"Should be corrected to
"version": "1.0.0",
"description": "",
"scripts": {
"start": "electron index.js"
},
"keywords": [],
"dependencies": {
"electron": "^10.1.1"
}
}
--Corrected the project name to test
.
--Modified to " name ":" test "
in package.json.
In my case, I have given the project name "electron" appropriately, so I have to give it another name, so I changed the project name to "test". Even if you install it as it is, you can not do it unless pakege.json is also changed, so fix that as well.
As a result, the installation was successful! !!
When deciding the project name, it was better to add "test" safely (^^;
see you!
Recommended Posts