Solve the problem that cloudbase framework cannot be installed

Problem Description

Recently, I was learning Tencent’s cloudbase framework. According to the official documents, I was unsuccessful. Later, I consulted with Tencent’s engineers and found that my cloudbase cli version was too low. I tried it last year but I didn’t care. This year I thought of using it and found that the version was low, but how to delete it It’s a problem. Later, I thought about uninstalling nodejs.

Reinstall nodejs

I have been using nodejs to install the next step without thinking, but this time it is not easy to use, because I thought about a question where is the npm package installed? Baidu took a look. It turns out that if npm is not set, it will be installed to the C drive by default. I said that the C drive of my computer has always been out of disk recently. It turned out that this was the cause, so Baidu again.
After creating two new folders node_global and node_cache in the installation directory of nodejs, you
Insert picture description here
need to modify the configuration of npm

npm config set prefix "D:\Program Files\nodejs\node_global"
npm config set cache "D:\Program Files\nodejs\node_cache"

Then install cloudbase cli

npm install -g @cloudbase/cli

Among them, -g refers to global installation,
Insert picture description here
which is executed after installing to the directory we just set

cloudbase -v

Insert picture description here
That's it this time.

Guess you like

Origin blog.csdn.net/u012877217/article/details/112705233