I'm trying to install some packages to my shared hosting account on namecheap servers,
I'm a complete begginer with node Js so please bare with me if this is a stupid quetion,
I initially tried to install two packages express & https
through the command line interface in CPanel, these two seemed to have installed, but it gave a warning about the package.json file.
The output is below
[letlziml@premium88 ~]$ npm install express
bash: npm: command not found
[letlziml@premium88 ~]$ cls
bash: cls: command not found
[letlziml@premium88 ~]$ source /home/letlziml/nodevenv/rootz/12/bin/activate
[rootz (12)] [letlziml@premium88 ~]$ cls
bash: cls: command not found
[rootz (12)] [letlziml@premium88 ~]$ cd /home/letlziml/rootz
[rootz (12)] [letlziml@premium88 rootz]$ npm install
ln: creating symbolic link `/home/letlziml/nodevenv/rootz/12/lib/package.json': No such file or directory
npm WARN saveError ENOENT: no such file or directory, open '/home/letlziml/nodevenv/rootz/12/lib/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/home/letlziml/nodevenv/rootz/12/lib/package.json'
npm WARN lib No description
npm WARN lib No repository field.
npm WARN lib No README data
npm WARN lib No license field.
audited 88 packages in 1.015s
found 0 vulnerabilities
[rootz (12)] [letlziml@premium88 rootz]$ npm install express
ln: creating symbolic link `/home/letlziml/nodevenv/rootz/12/lib/package.json': No such file or directory
npm WARN saveError ENOENT: no such file or directory, open '/home/letlziml/nodevenv/rootz/12/lib/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/home/letlziml/nodevenv/rootz/12/lib/package.json'
npm WARN lib No description
npm WARN lib No repository field.
npm WARN lib No README data
npm WARN lib No license field.
+ express@4.17.1
updated 1 package and audited 88 packages in 1.009s
found 0 vulnerabilities
[rootz (12)] [letlziml@premium88 rootz]$ npm install https
ln: creating symbolic link `/home/letlziml/nodevenv/rootz/12/lib/package.json': No such file or directory
npm WARN saveError ENOENT: no such file or directory, open '/home/letlziml/nodevenv/rootz/12/lib/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/home/letlziml/nodevenv/rootz/12/lib/package.json'
npm WARN lib No description
npm WARN lib No repository field.
npm WARN lib No README data
npm WARN lib No license field.
+ https@1.0.0
added 1 package from 1 contributor and audited 89 packages in 0.977s
found 0 vulnerabilities
[rootz (12)] [letlziml@premium88 rootz]$ npm install https
ln: creating symbolic link `/home/letlziml/nodevenv/rootz/12/lib/package.json': No such file or directory
npm ERR! code EJSONPARSE
npm ERR! file /home/letlziml/nodevenv/rootz/12/lib/package.json
npm ERR! JSON.parse Failed to parse json
npm ERR! JSON.parse Unexpected end of JSON input while parsing near ''
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! /home/letlziml/.npm/_logs/2020-10-09T11_07_13_947Z-debug.log
[rootz (12)] [letlziml@premium88 rootz]$ npm install wss
ln: creating symbolic link `/home/letlziml/nodevenv/rootz/12/lib/package.json': No such file or directory
npm ERR! code EJSONPARSE
npm ERR! file /home/letlziml/nodevenv/rootz/12/lib/package.json
npm ERR! JSON.parse Failed to parse json
npm ERR! JSON.parse Unexpected end of JSON input while parsing near ''
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! /home/letlziml/.npm/_logs/2020-10-09T11_09_42_615Z-debug.log
[rootz (12)] [letlziml@premium88 rootz]$ npm install 'wss'
ln: creating symbolic link `/home/letlziml/nodevenv/rootz/12/lib/package.json': No such file or directory
npm ERR! code EJSONPARSE
npm ERR! file /home/letlziml/nodevenv/rootz/12/lib/package.json
npm ERR! JSON.parse Failed to parse json
npm ERR! JSON.parse Unexpected end of JSON input while parsing near ''
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! /home/letlziml/.npm/_logs/2020-10-09T11_10_04_988Z-debug.log
[rootz (12)] [letlziml@premium88 rootz]$ npm install fs
ln: creating symbolic link `/home/letlziml/nodevenv/rootz/12/lib/package.json': No such file or directory
npm ERR! code EJSONPARSE
npm ERR! file /home/letlziml/nodevenv/rootz/12/lib/package.json
npm ERR! JSON.parse Failed to parse json
npm ERR! JSON.parse Unexpected end of JSON input while parsing near ''
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! /home/letlziml/.npm/_logs/2020-10-09T11_12_22_034Z-debug.log
[rootz (12)] [letlziml@premium88 rootz]$ source /home/letlziml/nodevenv/rootz/12/bin/activate && cd /home/letlziml/rootz
[rootz (12)] [letlziml@premium88 rootz]$ netsh /?
bash: netsh: command not found
[rootz (12)] [letlziml@premium88 rootz]$ /?
bash: /?: No such file or directory
[rootz (12)] [letlziml@premium88 rootz]$
it said that it cannot find the file package.json or could not read/parse this file. So I created a blank file to see if it would write data too it or populate it with the necessary info, now when i run npm on any module its no longer giving warnings and just throws an error... Does anybody know how to fix this?
pretty sure that both https & express installed properly as when I look in the modules folder they are now in there, when they were not before. However when i try to create a https server, the webpage is still throwing an error.
Have watched quite a few node tutorials on youtube, but this part is still confusing me.
ps. 1) What does ENOENT mean?
2) How do you auto populate the package.json file with all the correct info?