$ npm install
npm ERR! code EJSONPARSE
npm ERR! file /home/germanus/Documents/Angular_projects/demoproj/package.json
npm ERR! JSON.parse Failed to parse json
npm ERR! JSON.parse Unexpected token in JSON at position 0 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/germanus/.npm/_logs/2021-04-17T09_15_03_006Z-debug.log
delete package-lock.json
npm clear -f cache
npm i
删除node_modules
文件夹和package-lock.json
文件,然后执行以下命令可以解决问题:
npm install
它应该重新生成node_modules
文件夹和package-lock.json
文件。