出现这个原因有两个:
1.首先在Nacos配置中心,写入yml配置文件的数据和后端服务在取数据的时候名称不一致
如下图,现在我的配置中心为order-service

看看其中的文件内容信息:

再看看后端是怎么取的:

看出上面错误了吗,这个错误就是后端在取的时候,没有和配置中心文件保持一致,导致报如下错误:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'orderController': Injection of autowired dependencies failed; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'order.name' in value "${order.name}"
2.第二种情况就是,在后端配置nacos的时候没有配置正确,导致一直报错,也就是上面那一段错误信息

通过上面这个图片可以看出什么错误吗?
错误就是在配置中心不应该写discovery这个标签,因为它是nacos配置中心,不需要注册,它是在nacos中手动创建的,我们只是nacos配置文件中的值。
改成如下配置就行:

我认为应该是这样子的,祝你成功