package.json 移出依赖包的 ^ 前缀 运行 npm config set save-prefix=” 和 yarn config set save-prefix false ,它们将全局有效。 在项目目录创建 .npmrc 内容为 save-prefix= ,然后在项目目录创建 .yarnrc 内容为 save-prefix "" 无配置文件 有配置文件 再安装:npm install dayjs 就没有 ^ 前缀。 打赏赞微海报分享