记录运行项目的一些报错

一、git pull 报错

There is no tracking information for the current branch. Please specify whic...

There is no tracking information for the current branch.

Please specify which branch you want to merge with.

See git-pull(1) for details

git pull <remote> <branch>
If you wish to set tracking information for this branch you can do so with:

git branch --set-upstream-to=origin/<branch>

 问题原因:本地分支和远程分支没有建立联系

解决办法:运行提示给你的命令

git branch --set-upstream-to=origin/远程分支的名字  本地分支的名字

例如:远程分支叫vue_study 想要创建远程这个分支的本地分支,并关联起来

git branch --set-upstream-to=origin/vue_study  vue_study

正确的话返回下面代码:

Branch 'vue_study' set up to track remote branch 'vue_study' from 'origin'.

表示关联成功

再git pull下拉代码,就会成功了

二、You may use special comments to disable some warnings.

You may use special comments to disable some warnings.
Use // eslint-disable-next-line to ignore the next line.
Use /* eslint-disable */ to ignore all warnings in a file.

 解决办法:取消ESlint的检测,将useEslint设为false(可以全局搜一下,找到index.js这个文件下的useEslint,将值设为false)

三、npm i报错

104 packages are looking for funding
  run `npm fund` for details

 这个不算是报错,是给开源代码者捐钱的,

解决办法:

npm install --no-fund 

四、将远程git仓库里的指定分支拉取到本地(本地不存在的分支)报错

error: Your local changes to the following files would be overwritten by checkout:
        yarn.lock
Please commit your changes or stash them before you switch branches.
Aborting

 解决办法:

本地更改不重要,先取消,然后重新运行:

git checkout -b 本地分支名 origin/远程分支名

### 解决 Maven HelloWorld 项目中的 404 错误 当遇到 Maven HelloWorld 项目的 404 错误时,这通常意味着请求的资源未被正确映射到应用程序中。以下是几种可能的原因及其解决方案: #### 1. 检查应用启动类的位置 确保 Spring Boot 的 `@SpringBootApplication` 注解位于包结构的根目录下,以便能够扫描并加载所有的组件和服务。 ```java package com.example.demo; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class DemoApplication { public static void main(String[] args) { SpringApplication.run(DemoApplication.class, args); } } ``` #### 2. 控制器配置不当 确认控制器已正确定义,并且带有正确的 URL 映射。如果路径不匹配,则可能导致返回 404 页面。 ```java package com.example.demo.controller; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; @RestController public class HelloController { @GetMapping("/hello") public String hello() { return "Hello World!"; } } ``` #### 3. 应用属性文件设置 检查 application.properties 或者 application.yml 文件里是否有影响 web 访问路径的相关配置项。例如端口号、上下文路径等。 ```properties server.port=8080 server.servlet.context-path=/api/v1 ``` #### 4. 构建工具配置问题 有时构建工具如 Maven 可能未能正确解析依赖关系或打包方式不对,从而引发静态资源无法访问等问题。可以尝试清理本地仓库缓存后再重新编译部署。 对于 maven 路径找不到的情况,在开始界面中 config 设置 Project defaults → setting 中,找到 Maven → Runner, 新增参数 M2_HOME 和 VM Options 参数来指定 maven 安装位置[^1]。 #### 5. 日志记录框架冲突 日志库版本兼容性不佳也可能造成异常行为。比如 Log4jConfigListener 类丢失就会抛出 ClassNotFoundException 异常[^2]。此时应调整 pom.xml 来排除不必要的 log 实现依赖,只保留 slf4j-api 加上具体实现(像 logback-classic)即可。 通过以上几个方面逐一排查应该能找到引起 404 原因所在,并采取相应措施加以修复。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值