Git 2.20安装hexo出现的问题 npm: command not found


今天安装hexo出现了一个问题,我的Git和nodejs都是安装在D盘下面的,通过Git bash here安装hexo出现问题,下面写一下解决方法

打开安装路径下的D盘中的Git Bash here

Git 2.20安装hexo出现的问题 npm: command not found

在打开的界面中输入一下代码:

1、安装hexo

//安装hexo
[email protected]-pc MINGW64 /
$ npm install hexo-cli -g
//运行结果
C:\Users\hp\AppData\Roaming\npm\hexo -> C:\Users\hp\AppData\Roaming\npm\node_modules\hexo-cli\bin\hexo
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected]1.2.7 (node_modules\hexo-cli\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]1.2.7: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

2、将hexo部署到Git page的deployer

//hexo部署
[email protected]-pc MINGW64 /
$ npm install hexo-deployer-git
//运行结果
npm WARN saveError ENOENT: no such file or directory, open 'D:\Myblog\Git\package.json'
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN enoent ENOENT: no such file or directory, open 'D:\Myblog\Git\package.json'
npm WARN babel-[email protected]10.0.1 requires a peer of [email protected]>= 4.12.1 but none is installed. You must install peer dependencies yourself.
npm WARN Git No description
npm WARN Git No repository field.
npm WARN Git No README data
npm WARN Git No license field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected]1.2.7 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]1.2.7: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

+ hexo-deployer-[email protected]1.0.0
added 204 packages from 400 contributors and audited 2254 packages in 15.598s
found 0 vulnerabilities

下载npm文件夹代码如下:

// 下载npm文件到桌面
[email protected]-pc MINGW64 ~/Desktop
$ git clone --recursive git://github.com/isaacs/npm.git
//运行结果
Cloning into 'npm'...
remote: Enumerating objects: 21, done.
remote: Total 21 (delta 0), reused 0 (delta 0), pack-reused 21
Receiving objects: 100% (21/21), 17.87 KiB | 99.00 KiB/s, done.
Resolving deltas: 100% (2/2), done.

参考博客地址如下:
1、https://blog.csdn.net/grave2015/article/details/79961843
2、https://blog.csdn.net/daocaoren92wq/article/details/64444532