[英]Unable to start a Vue CLI project
I'm trying to use Vue CLI.我正在尝试使用 Vue CLI。 Several months ago I could use it without a problem, but when I tried the command
npm install -g @vue/cli
just a moment ago, I got a warning npm WARN deprecated request@2.88.2: request has been deprecated
.几个月前我可以毫无问题地使用它,但是当我刚才尝试命令
npm install -g @vue/cli
,我收到一条警告npm WARN deprecated request@2.88.2: request has been deprecated
。
I tried to make a vue cli project by the command vue init webpack-simple main-page
, I got an error message bash: vue: command not found
and I couldn't go any futher.我试图通过命令
vue init webpack-simple main-page
创建一个 vue cli 项目,我收到一条错误消息bash: vue: command not found
,我不能再继续了。
While I was researching I found the following page,在我研究时,我发现了以下页面,
https://github.com/node-gh/gh/issues/761 https://github.com/node-gh/gh/issues/761
and found out that "This request is deprecated as of February 11th, 2020", but what I don't understand is what I should use for instead of this "deprecated request", and how to do it.并发现“此请求已于 2020 年 2 月 11 日弃用”,但我不明白的是我应该使用什么来代替“已弃用的请求”,以及如何使用。
Also, in the link above there is a further link, https://github.com/request/request/issues/3143 , which presents a list of some alternatives in this kind of issue, but I don't really understand what this means.此外,在上面的链接中有一个进一步的链接, https://github.com/request/request/issues/3143 ,它提供了此类问题中一些替代方案的列表,但我真的不明白这是什么方法。 The list for example includes
node-fetch
, make-fetch-happen
, etc. as "alternative libraries to request", but how do I find out which one is the one to be replaced with request@2.88.2:
?例如,该列表包括
node-fetch
、 make-fetch-happen
等作为“要请求的替代库”,但是我如何找出哪个是要替换为request@2.88.2:
Also, if I find out which one is the alternative to use instead, what should I do?另外,如果我发现哪个是替代品,我该怎么办? Just install a particular library, like
npm install node-fetch
?只需安装一个特定的库,比如
npm install node-fetch
?
My OS is Windows 10, and Node.js, which is needed in order to use npm is already installed.我的操作系统是 Windows 10,并且已经安装了使用 npm 所需的 Node.js。
As far as I know, this is not a problem.据我所知,这不是问题。 You've installed vue cli 4.x and vue init is used in vue 2.x .. to make sure you have vue-cli installed run the following command
你已经安装了 vue cli 4.x 并且 vue init 用于 vue 2.x .. 以确保你已经安装了 vue-cli 运行以下命令
> vue --version
to create an app just run the following command.要创建应用程序,只需运行以下命令。
> vue create <app_name>
then follow the cli steps然后按照cli步骤
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.