陈睿铭 2022-08-30 16:33 采纳率: 0%
浏览 88

代码无法npm install 代码无法运行

问题遇到的现象和发生背景

刚从git上面拉下来的代码,我需要跑起来 代码拿到vscoed 命令行输入 npm install 后报错

问题相关代码,请勿粘贴截图

运行 npm install 报错如下

npm ERR! code ERESOLVE

npm ERR!
npm ERR! While resolving: relytosoft.lms@1.0.0
npm ERR! Found: html-webpack-plugin@4.0.0-alpha
npm ERR! node_modules/html-webpack-plugin
npm ERR! dev html-webpack-plugin@"4.0.0-alpha" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! node_modules/script-ext-html-webpack-plugin
npm ERR! dev script-ext-html-webpack-plugin@"2.0.1" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR!
npm ERR! See F:\Program\eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR! F:\Program_logs\2022-08-30T08_07_46_509Z-debug-0.log

运行结果及报错内容

运行 npm install 报错如下

npm ERR! code ERESOLVE

npm ERR!
npm ERR! While resolving: relytosoft.lms@1.0.0
npm ERR! Found: html-webpack-plugin@4.0.0-alpha
npm ERR! node_modules/html-webpack-plugin
npm ERR! dev html-webpack-plugin@"4.0.0-alpha" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! node_modules/script-ext-html-webpack-plugin
npm ERR! dev script-ext-html-webpack-plugin@"2.0.1" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR!
npm ERR! See F:\Program\eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR! F:\Program_logs\2022-08-30T08_07_46_509Z-debug-0.log

我的解答思路和尝试过的方法

按照你的方法 npm install -g cnpm --registry=http://registry.npm.taobao.org/
安装完之后可以通过cnpm -v 检验后报错 (红色的)
cnpm : 无法将“cnpm”项识别为 cmdlet、函数、脚本文件或可运行程序的名称。请检查名称的拼写,如果包括路径,请确保路径正确,然后再试一次。
所在位置 行:1 字符: 1

  • cnpm -v
    • CategoryInfo : ObjectNotFound: (cnpm:String) [], CommandNotFoundException
    • FullyQualifiedErrorId : CommandNotFoundException
      我想要达到的结果
      代码能运行起来
  • 写回答

3条回答 默认 最新

  • 马卫斌 前端工程师 2022-08-30 16:42
    关注

    你试试下面的方法:

    npm install --registry=https://registry.npmmirror.com
    
    评论

报告相同问题?

问题事件

  • 创建了问题 8月30日

悬赏问题

  • ¥15 关于#java#的问题,请各位专家解答!
  • ¥15 急matlab编程仿真二阶震荡系统
  • ¥20 TEC-9的数据通路实验
  • ¥15 ue5 .3之前好好的现在只要是激活关卡就会崩溃
  • ¥50 MATLAB实现圆柱体容器内球形颗粒堆积
  • ¥15 python如何将动态的多个子列表,拼接后进行集合的交集
  • ¥20 vitis-ai量化基于pytorch框架下的yolov5模型
  • ¥15 如何实现H5在QQ平台上的二次分享卡片效果?
  • ¥30 求解达问题(有红包)
  • ¥15 请解包一个pak文件