node.js – Lite Server Issue (Will Not Execute)

Good Morning Everyone,

I’m having some issues with running lite server (I’m a total noob to this). When I attempt to launch it via terminal with the nvm start command, I get the error below (I pasted a copy of the most recent log file). I’ve been searching for answers on how to fix this, and have pasted the package.json source into a JSON validation checker, and I seem to get no issues at all. I’ve also tried to clear the cache using the npm cache clean –force command, and I’m still getting the error message.

        Here is the log file output:
            
        0 info it worked if it ends with ok
        1 verbose cli (
        1 verbose cli   '/Users/mymac/.nvm/versions/node/v14.9.0/bin/node',
        1 verbose cli   '/Users/mymac/.nvm/versions/node/v14.9.0/bin/npm',
        1 verbose cli   'start'
        1 verbose cli )
        2 info using npm@6.14.8
        3 info using node@v14.9.0
        4 verbose stack Error: Failed to parse json
        4 verbose stack Unexpected token } in JSON at position 279 while parsing near '..."type": "git",
        4 verbose stack
        4 verbose stack   },
        4 verbose stack   "author": "",
        4 verbose stack  ...'
        4 verbose stack     at parseError (/Users/mymac/.nvm/versions/node/v14.9.0/lib/node_modules/npm/node_modules/read-package-json/read-json.js:470:11)
        4 verbose stack     at parseJson (/Users/mymac/.nvm/versions/node/v14.9.0/lib/node_modules/npm/node_modules/read-package-json/read-json.js:105:26)
        4 verbose stack     at /Users/mymac/.nvm/versions/node/v14.9.0/lib/node_modules/npm/node_modules/read-package-json/read-json.js:52:5
        4 verbose stack     at /Users/mymac/.nvm/versions/node/v14.9.0/lib/node_modules/npm/node_modules/graceful-fs/graceful-fs.js:123:16
        4 verbose stack     at FSReqCallback.readFileAfterClose (as oncomplete) (internal/fs/read_file_context.js:63:3)
        5 verbose cwd /Users/mymac/Desktop/NucampFolder/git-test
        6 verbose Darwin 20.2.0
        7 verbose argv "/Users/mymac/.nvm/versions/node/v14.9.0/bin/node" "/Users/mymac/.nvm/versions/node/v14.9.0/bin/npm" "start"
        8 verbose node v14.9.0
        9 verbose npm  v6.14.8
        10 error code EJSONPARSE
        11 error file /Users/mymac/Desktop/NucampFolder/git-test/package.json
        12 error JSON.parse Failed to parse json
        12 error JSON.parse Unexpected token } in JSON at position 279 while parsing near '..."type": "git",
        12 error JSON.parse
        12 error JSON.parse   },
        12 error JSON.parse   "author": "",
        12 error JSON.parse  ...'
        13 error JSON.parse Failed to parse package.json data.
        13 error JSON.parse package.json must be actual JSON, not just JavaScript.
        14 verbose exit ( 1, true )
```
        
        Here are the error codes after executing via Terminal:
          
        npm ERR! code EJSONPARSE
        npm ERR! file /Users/mymac/Desktop/NucampFolder/git-test/package.json
        npm ERR! JSON.parse Failed to parse json
        npm ERR! JSON.parse Unexpected token } in JSON at position 279 while parsing near '..."type": "git",
        npm ERR! JSON.parse   
        npm ERR! JSON.parse   },
        npm ERR! JSON.parse   "author": "",
        npm ERR! JSON.parse  ...'
        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!     /Users/mymac/.npm/_logs/2021-01-12T14_41_54_399Z-debug.log
        
        Here is the package.json file contents:
        {
          "name": "git-test",
          "version": "1.0.0",
          "description": "Git and Node",
          "main": "index.html",
          "scripts": {
            "test": "echo "Error: no test specified" && exit 1",
            "start": "npm run lite",
            "lite": "lite-server"
          },
          "repository": {
            "type": "git"
          
          },
          "author": "",
          "license": "ISC",
          "devDependencies": {
            "lite-server": "^2.6.1"
          }
        }
  
        

A few important things to note. When I ran the initial installation command, I received a warning message stating a vulnerability was found and elected to install the fix, and changed the package.json contents after doing so, which leads me to believe that I may need to uninstall/reinstall lite-server. I’m taking an online course and made changes to the original file per the course instructions, which may have led to this error. I’m ultimately just trying to get this to work so that way I can test locally. Does anyone know a possible solution to this?