Installing package.json is kinda simple though. When you have enough time, try to give a read of what
package.json does in :
NPM Docs. You can install package.json by typing this command in terminal :
npm init -y
This should probably create the package.json file for you in your directory and then try the procedure which I mentioned in post
#16 Based on my previous experience on this altcoin creation and stack overflow answers, I believe you should be running an older version of Node.js but I am not really sure though!
Some important links which helped me during the npm install process :
1.
npm can't find package.json2.
npm WARN enoent ENOENT: no such file or directory, open 'C:\Users\Nuwanst\package.json'its amazin that json page, i assumed that as much as simpler better, so i made next steps:
1- deleted package-lock.json and node_modules
2- step by step on terminal:
npm cache clear --force
npm install
npm init -y
giving out:
root@ubuntu:/home/asus/XxxxxCoin# npm init -y
Wrote to /home/asus/XxxxxCoin/package.json:
{
"name": "XxxxxCoin",
"version": "1.0.0",
"description": "XxxxxCoinCore integration/staging tree =====================================",
"main": "index.js",
"directories": {
"doc": "doc",
"test": "test"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/xxxxxxxxxxx/XxxxxCoin.git"
},
"keywords": [],
"author": "",
"license": "ISC",
"bugs": {
"url": "https://github.com/xxxxxxxxx/XxxxxCoin/issues"
},
"homepage": "https://github.com/xxxxxxxx/XxxxxCoin#readme"
}
once done, NANO the package.json to edit some points such as keywords trying to add contact, author, etc.
****as it is unlimited the aditions you can go, I left it as much as simple with no aditions to the file so it will be easy to parse and close
but then, when I go for
npm init -y
it makes this error, wich even researching on the web i cannot understand for now:
oot@ubuntu:/home/asus/XxxxxCoin# npm install
npm ERR! code EJSONPARSE
npm ERR! file /home/asus/XxxxxCoin/package.json
npm ERR! JSON.parse Failed to parse json
npm ERR! JSON.parse Unexpected string in JSON at position 651 while parsing '{
npm ERR! JSON.parse "name": "XxxxxCoin",
npm ERR! JSON.parse "version": "'
npm ERR! JSON.parse Failed to parse package.json data.
npm ERR! JSON.parse package.json must be actual JSON, not just JavaScript.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2021-03-08T10_23_37_464Z-debug.log
errors i found:
- parsing
- filling up name and version?
already is done in the file.... (¿?¿?¿?)
- changing to JSON file and not java
still researching this problems to try to solve them
the incredible thing, is that once all this fails, if i execute:
root@ubuntu:/home/asus/XxxxxCoin# npm install
npm notice created a lockfile as package-lock.json. You should commit this file.
up to date in 0.279s
and it works...
I might be wrong from my point of view?¿
ps, my package.json used as testing:
{
"name": "XxxxxCoin",
"version": "1.0.0",
"description": "XxxxxCoinCore integration/staging tree =====================================",
"main": "index.js",
"directories": {
"doc": "doc",
"test": "test"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/zzzzzzzz/XxxxxCoin.git"
},
"keywords": [],
"author": "",
"license": "ISC",
"bugs": {
"url": "https://github.com/zzzzzzzz/XxxxxCoin/issues"
},
"homepage": "https://github.com/zzzzzzzz/XxxxxCoin#readme"
}