如果nacos下载完成后直接启动会报错如下错误
![](https://img-blog.csdnimg.cn/img_convert/664914750c913fd76c15cb1ef19bb903.png)
![](https://img-blog.csdnimg.cn/img_convert/bd73cc50bcf1a2b2069755b07b92af51.png)
解决方法:打开你nacos文件找到bin文件下得startup.cmd文件打开
把set MODE="cluster"修改为set MODE="standalone" (cluster为集群启动 standalone为单机启动)(rem是注释得意思)
如下:
![](https://img-blog.csdnimg.cn/img_convert/2df11cee06f28c14c67f65e76ae511f0.png)
![](https://img-blog.csdnimg.cn/img_convert/2b776b08a4579da427d2bb7d488958f1.png)
再次启动 会报如下错误:
Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'user': Unsatisfied dependency expressed through field 'jwtTokenManager';
![](https://img-blog.csdnimg.cn/img_convert/bb15729cc520e7580134256cdb023fa4.png)
解决方法 打开你nacos文件找到conf文件下得application.properties 打开
找到 nacos.core.auth.plugin.nacos.token.secret.key= 在 后面加上 密钥
SecretKey012345678901234567890123456789012345678901234567890123456789
因为nacos 2.2.0.1版本后 默认得key值为空,需要手动加上
![](https://img-blog.csdnimg.cn/img_convert/164a5d5c1143e53f6cb508132e4a937e.png)
如下:
![](https://img-blog.csdnimg.cn/img_convert/7a202f8437ddee8bb3b6bbdc46425473.png)
添加完成后 重启nacos 启动成功
![](https://img-blog.csdnimg.cn/img_convert/baf751eac1e719c14dfba1fbcc907776.png)
成功解决,希望这篇文章对你们有所帮助