我在运行npm i -g @vue/cli
时收到这些警告-如何调查并解决问题?
npm WARN deprecated @hapi/joi@15.1.1: joi is leaving the @hapi organization and moving back to 'joi' (https://github.com/sideway/joi/issues/2411)
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated @hapi/bourne@1.3.2: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/address@2.1.4: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/hoek@8.5.1: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/topo@3.1.6: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm ERR! Unexpected end of JSON input while parsing near '...omposition":"6.0.1-al'
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Micheal\AppData\Roaming\npm-cache\_lo
答案 0 :(得分:0)
您在这里收到的错误是:
Unexpected end of JSON input while parsing near '...omposition":"6.0.1-al'
此错误表示文件包含无效的JSON,但没有告诉您文件是哪个文件。
但是,因为它是npm
,所以最有可能的候选者是package.json
-在该文件中搜索“ 6.01-al”,看看是否可以找到错误。这几乎总是由手动编辑package.json文件中的依赖项引起的。
在这种情况下,错误似乎是文件已被截断,在这种情况下,它可能是您正在安装的软件包之一,无法正确下载或在途中已损坏。如果可以,请尝试将软件包安装在另一台计算机上。