npm安装hexo报错

2023-02-16,,,

报错提示

npm WARN saveError ENOENT: no such file or directory, open '/home/linux1/package.json'
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN notsup Unsupported engine for hexo-util@2.6.0: wanted: {"node":">=12.4.0"} (current: {"node":"10.19.0","npm":"6.14.4"})
npm WARN notsup Not compatible with your version of node/npm: hexo-util@2.6.0
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.3.2 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"s390x"})
npm WARN notsup Unsupported engine for highlight.js@11.5.1: wanted: {"node":">=12.0.0"} (current: {"node":"10.19.0","npm":"6.14.4"})
npm WARN notsup Not compatible with your version of node/npm: highlight.js@11.5.1
npm WARN notsup Unsupported engine for hexo-log@3.0.0: wanted: {"node":">=12.4.0"} (current: {"node":"10.19.0","npm":"6.14.4"})
npm WARN notsup Not compatible with your version of node/npm: hexo-log@3.0.0
npm WARN enoent ENOENT: no such file or directory, open '/home/linux1/package.json'
npm WARN linux1 No description
npm WARN linux1 No repository field.
npm WARN linux1 No README data
npm WARN linux1 No license field.

报错原因

考虑到npm源的问题,默认的应该是淘宝源,可以使用npm get registry来查看当前的源,切换成原镜像源即可

解决方法

切换命令:npm config set registry https://registry.npmjs.org/

npm安装hexo报错的相关教程结束。

《npm安装hexo报错.doc》

下载本文的Word格式文档,以方便收藏与打印。