简体   繁体   English

我已将 angular 项目从一台计算机迁移到另一台计算机,当我运行“npm i”时,它给了我这些错误

[英]i have migrated angular project from one computer to another and when I run `npm i` it gives me these errors

$ 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

Deleting node_modules folder and package-lock.json file and then executing the following command could resolve your issue:删除node_modules文件夹和package-lock.json文件,然后执行以下命令可以解决您的问题:

npm install

It should re-generate the node_modules folder and package-lock.json file.它应该重新生成node_modules文件夹和package-lock.json文件。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我想运行一个从 github 下载的 angular 项目。 但我看到有几个依赖错误 - I want to run an angular project which I have downloaded from github. But I see there are several dependency errors 当我运行 npm 时,在我的计算机中使用 -g 命令安装 angular cli,默认情况下将安装它 - When I run npm install angular cli with -g command in my computer in which place it will be installed by default 为什么每次创建一个新的angular 2项目时都必须运行npm install? - Why Do I have to run npm install everytime I create a new angular 2 project? 我有角模型类,具有变量和函数,所以当我调用函数时会给我错误 - I have class models in angular having variables and functions so when I call the function it gives me error 当我运行“ npm start”时,在正常的Angular 2项目上会收到“ SyntaxError:意外的令牌导入” - When I run “npm start” I get a “SyntaxError: Unexpected token import” on a normal Angular 2 project 当我在 Angular 9 中运行 npm start 时出现“内部错误中的错误:意外插值”错误 - I have "ERROR in Internal Error: Unexpected interpolation" error when I run npm start in Angular 9 我正在设置一个离子项目并在运行命令 npm install 时遇到这些错误 - I'm setting up an ionic project and getting these errors when run the command npm install 为什么在 macOS Catalina 上尝试为 Angular 项目运行 npm install 时会出现这些故障? - Why am I getting these failures when trying to run npm install for an Angular project on macOS Catalina? 我正在使用CEAN应用程序。 当我尝试为角度运行npm start时,出现以下错误: - I am using a CEAN app. Following errors appear when I am trying to run npm start for angular: 我已经安装了 npm install fontawesome-free,仍然给我这个错误 - I have install npm install fontawesome-free, still gives me this error
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM