1. 如果nacos下载完成后直接启动会报错如下错误

解决方法:打开你nacos文件找到bin文件下得startup.cmd文件打开

把set MODE=”cluster”修改为set MODE=”standalone” (cluster为集群启动 standalone为单机启动)(rem是注释得意思)

如下:

  1. 再次启动 会报如下错误:

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’;

解决方法 打开你nacos文件找到conf文件下得application.properties 打开

找到 nacos.core.auth.plugin.nacos.token.secret.key= 在 后面加上 密钥

SecretKey012345678901234567890123456789012345678901234567890123456789

借鉴得(https://blog.csdn.net/lad_z/article/details/129336454?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522167824647116800226517904%2522%252C%2522scm%2522%253A%252220140713.130102334.pc%255Fall.%2522%257D&request_id=167824647116800226517904&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2~all~first_rank_ecpm_v1~rank_v31_ecpm-14-129336454-null-null.142^v73^insert_down3,201^v4^add_ask,239^v2^insert_chatgpt&utm_term=nacos%E5%90%AF%E5%8A%A8org.springframework.beans.factory.UnsatisfiedDependencyException%3A%20Error%20creating%20bean%20with%20name%20user&spm=1018.2226.3001.4187)文章

因为nacos 2.2.0.1版本后 默认得key值为空,需要手动加上

如下:

  1. 添加完成后 重启nacos 启动成功

成功解决,希望这篇文章对你们有所帮助