Javascript npm WARN在运行时已弃用';vue init网页包我的项目';

Javascript npm WARN在运行时已弃用';vue init网页包我的项目';,javascript,vue.js,npm,webpack,Javascript,Vue.js,Npm,Webpack,我的目标:想通过运行命令来初始化Vue.js项目Vue init webpack myproject 预期结果:安装所有依赖项,没有致命错误,并且能够通过npm dev run开始运行项目,并在上运行项目 实际结果: # Installing project dependencies ... # ======================== npm WARN deprecated extract-text-webpack-plugin@3.0.2: Deprecated. Please u

我的目标:想通过运行命令来初始化Vue.js项目
Vue init webpack myproject

预期结果:安装所有依赖项,没有致命错误,并且能够通过
npm dev run
开始运行项目,并在上运行项目

实际结果

# Installing project dependencies ...
# ========================

npm WARN deprecated extract-text-webpack-plugin@3.0.2: Deprecated. Please use https://gi
thub.com/webpack-contrib/mini-css-extract-plugin
npm WARN deprecated browserslist@2.11.3: Browserslist 2 could fail on reading Browsersli
st >3.0 config used in other tools.
npm WARN deprecated bfj-node4@5.3.1: Switch to the `bfj` package for fixes and new featu
res!
npm WARN deprecated core-js@2.6.11: core-js@<3 is no longer maintained and not recommend
ed for usage due to the number of issues. Please, upgrade your dependencies to the actua
l version of core-js@3.
npm WARN deprecated browserslist@1.7.7: Browserslist 2 could fail on reading Browserslis
t >3.0 config used in other tools.
npm WARN deprecated circular-json@0.3.3: CircularJSON is in maintenance only, flatted is
 its successor.
npm ERR! Unexpected end of JSON input while parsing near '...,"dist":{"shasum":"1e'

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Administrator\AppData\Roaming\npm-cache\_logs\2020-02-12T06_01_01_
430Z-debug.log


Running eslint --fix to comply with chosen preset rules...
# ========================


> travel@1.0.0 lint F:\SourceCode\Travel-master\Travel
> eslint --ext .js,.vue src "--fix"


Oops! Something went wrong! :(

ESLint: 6.8.0.

ESLint couldn't find the plugin "eslint-plugin-vue".

(The package "eslint-plugin-vue" was not found when loaded as a Node module from the dir
ectory "F:\SourceCode\Travel-master\Travel".)

It's likely that the plugin isn't installed correctly. Try reinstalling by running the f
ollowing:

    npm install eslint-plugin-vue@latest --save-dev

The plugin "eslint-plugin-vue" was referenced from the config file in ".eslintrc.js".

If you still can't figure out the problem, please stop by https://gitter.im/eslint/eslin
t to chat with the team.

npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! travel@1.0.0 lint: `eslint --ext .js,.vue src "--fix"`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the travel@1.0.0 lint script.
npm ERR! This is probably not a problem with npm. There is likely additional logging out
put above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Administrator\AppData\Roaming\npm-cache\_logs\2020-02-12T06_01_04_
492Z-debug.log

# Project initialization finished!
# ========================

To get started:

  cd Travel
  npm run dev

Documentation can be found at https://vuejs-templates.github.io/webpack


甚至我尝试了
npm安装webpack-dev server-g
,然后出现了另一个问题,如下所示:

npm ERR! code ETARGET
npm ERR! notarget No matching version found for eslint-plugin-vue@lastest.
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Administrator\AppData\Roaming\npm-cache\_logs\2020-02-12T06_09_11_
766Z-debug.log
C:\Program Files\nodejs\webpack -> C:\Program Files\nodejs\node_modules\webpack\bin\webp
ack.js
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.11 (node_modules\webpack\no
de_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.11:
wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

+ webpack@4.41.6
added 322 packages from 197 contributors in 255.517s


在编写我的应用程序(MEVN)和使用命令
vue init webpack client
时,我遇到了同样的问题

所以我做了一些研究,特别是在npm上,看看哪里出了问题,发现了这个:显然你不能再使用这个命令了

因此,如果您希望使用vue cli,则需要通过
npm install-g@vue/cli安装它,然后运行
vue create

有关更多信息,您可以查看以下文档:vuejs网站上的文档:


希望这有助于您愉快地编码

您的错误显示您的命令使用了
lastest
而不是
latest
。但在任何情况下,您尝试创建的项目都早已被Vue CLI淘汰。您可以使用
vue create myproject
创建最新的项目。注意,它抽象了webpack配置(将您屏蔽),但您可以在
vue.config.js
中配置它。