【问题标题】:Vue Javascript with npm install command带有 npm install 命令的 Vue Javascript
【发布时间】:2020-08-21 08:04:33
【问题描述】:

我是新的 Vue JS 学习者。想要安装 Vue 并有兴趣在其中创建 Web 应用程序。所以,全局添加了 npm Vue

npm install --global vue-cli

这给了我:

npm WARN deprecated vue-cli@2.9.6: This package has been deprecated in favour of @vue/cli
npm WARN deprecated coffee-script@1.12.7: CoffeeScript on NPM has moved to "coffeescript" (no hyphen)
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
C:\Users\Abhilash\AppData\Roaming\npm\vue -> C:\Users\Abhilash\AppData\Roaming\npm\node_modules\vue-cli\bin\vue
C:\Users\Abhilash\AppData\Roaming\npm\vue-init -> C:\Users\Abhilash\AppData\Roaming\npm\node_modules\vue-cli\bin\vue-init
C:\Users\Abhilash\AppData\Roaming\npm\vue-list -> C:\Users\Abhilash\AppData\Roaming\npm\node_modules\vue-cli\bin\vue-list
+ vue-cli@2.9.6
updated 1 package in 17.266s

后来我创建了新项目

vue init webpack my-project

这创建了一些文件夹和文件(还有 Package.json)

稍后按照程序给定的 cmd 为:

cd my-project
npm install

这会导致错误:

npm WARN deprecated extract-text-webpack-plugin@3.0.2: Deprecated. Please use https://github.com/webpack-contrib/mini-css-extract-plugin
npm WARN deprecated browserslist@2.11.3: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
npm WARN deprecated core-js@2.6.11: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated bfj-node4@5.3.1: Switch to the `bfj` package for fixes and new features!
npm WARN deprecated mkdirp@0.5.1: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)
npm WARN deprecated json3@3.3.2: Please use the native JSON object instead of JSON 3
npm WARN deprecated browserslist@1.7.7: Browserslist 2 could fail on reading Browserslist >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 WARN deprecated socks@1.1.10: If using 2.x branch, please upgrade to at least 2.1.6 to avoid a serious bug with socket data flow and an import issue introduced in 2.1.0
npm WARN deprecated left-pad@1.3.0: use String.prototype.padStart()
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm ERR! Unexpected end of JSON input while parsing near '...0-rc.2":{"name":"@bab'

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Abhilash\AppData\Roaming\npm-cache\_logs\2020-05-06T11_17_51_094Z-debug.log

发生了什么事?任何人都可以解释我的详细信息..我的错误是什么?

【问题讨论】:

  • 你试过 npm cache clean --force 吗?
  • 就在它警告你包vue-cli已被弃用的开始......那是因为它已被弃用。有关最新版本的 CLI,请参阅 cli.vuejs.org/guide/installation.html。现在改为 @vue/cli
  • @VladSerdyuk 我可以知道清理缓存的 cmd
  • @skirtle 对不起,我没听懂你......你能详细回答一下吗
  • 您使用的命令很旧,可能无法正常工作。无论您遵循什么指南都已过时,您应该停止使用它。请参阅我提供的链接以获取最新文档。

标签: javascript vue.js npm npm-install


【解决方案1】:

尝试以相同的顺序使用这些命令-

      npm install vue
      npm cache clean --force
      npm install -g @vue/cli

【讨论】:

    猜你喜欢
    • 2021-09-09
    • 2019-05-24
    • 2020-06-05
    • 2015-01-15
    • 2013-10-12
    • 1970-01-01
    • 2016-02-08
    • 2017-12-19
    • 2017-09-14
    相关资源
    最近更新 更多