‘npm‘ 不是内部或外部命令,也不是可运行的程序 或批处理文件。nvm不是全局变量

问题:

1,我的nvm不是全局变量

‘npm’ 不是内部或外部命令,也不是可运行的程序
或批处理文件。
在这里插入图片描述

方法一:
更改全局变量:
参考博客

方法二:
卸载重装
参考博客

方法三:
使用nvm
在这里插入图片描述
重启电脑

C:\Users\86178>hexo -v
hexo-cli: 4.3.1
os: win32 10.0.18363
node: 16.14.0
v8: 9.4.146.24-node.20
uv: 1.43.0
zlib: 1.2.11
brotli: 1.0.9
ares: 1.18.1
modules: 93
nghttp2: 1.45.1
napi: 8
llhttp: 6.0.4
openssl: 1.1.1m+quic
cldr: 40.0
icu: 70.1
tz: 2021a3
unicode: 14.0
ngtcp2: 0.1.0-DEV
nghttp3: 0.1.0-DEV

C:\Users\86178>

用阿里的国内镜像进行设置
 npm config set registry https://registry.npm.taobao.org
安装 Hexo
 npm i hexo-cli -g


在这里插入图片描述

C:\Users\86178\AppData\Roaming\npm\node_modules\hexo-cli\bin\hexo

E:\astudy\blog>npm i hexo-cli -g
C:\Users\86178>cnpm install -g hexo-cli
Downloading hexo-cli to C:\Users\86178\AppData\Roaming\npm\node_modules\hexo-cli_tmp
Copying C:\Users\86178\AppData\Roaming\npm\node_modules\hexo-cli_tmp\.store\hexo-cli@4.3.1\node_modules\hexo-cli to C:\Users\86178\AppData\Roaming\npm\node_modules\hexo-cli
Installing hexo-cli's dependencies to C:\Users\86178\AppData\Roaming\npm\node_modules\hexo-cli/node_modules
[1/10] command-exists@^1.2.9 installed at node_modules\.store\command-exists@1.2.9\node_modules\command-exists
[2/10] picocolors@^1.0.0 installed at node_modules\.store\picocolors@1.0.0\node_modules\picocolors
[3/10] hexo-log@^4.0.1 installed at node_modules\.store\hexo-log@4.1.0\node_modules\hexo-log
[4/10] tildify@^2.0.0 installed at node_modules\.store\tildify@2.0.0\node_modules\tildify
[5/10] abbrev@^2.0.0 installed at node_modules\.store\abbrev@2.0.0\node_modules\abbrev
[6/10] minimist@^1.2.5 installed at node_modules\.store\minimist@1.2.8\node_modules\minimist
[7/10] bluebird@^3.7.2 installed at node_modules\.store\bluebird@3.7.2\node_modules\bluebird
[8/10] hexo-fs@^4.1.1 installed at node_modules\.store\hexo-fs@4.1.1\node_modules\hexo-fs
[9/10] resolve@^1.20.0 installed at node_modules\.store\resolve@1.22.8\node_modules\resolve
[10/10] hexo-util@^2.5.0 installed at node_modules\.store\hexo-util@2.7.0\node_modules\hexo-util
Recently updated (since 2023-10-08): 2 packages (detail see file C:\Users\86178\AppData\Roaming\npm\node_modules\hexo-cli\node_modules\.recently_updates.txt)
  2023-10-11
    → resolve@^1.20.0(1.22.8) (05:37:14)
  2023-10-09
    → hexo-util@2.7.0 › highlight.js@^11.0.1(11.9.0) (11:53:05)
All packages installed (52 packages installed from npm registry, used 5s(network 5s), speed 5.73KB/s, json 2(27.71KB), tarball 0B, manifests cache hit 50, etag hit 50 / miss 2)
[hexo-cli@4.3.1] link C:\Users\86178\AppData\Roaming\npm\hexo@ -> C:\Users\86178\AppData\Roaming\npm\node_modules\hexo-cli\bin\hexo

方法4:使用npx命令

参考博客

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值