无法安装vue + webpack模板

时间:2018-06-07 18:38:16

标签: webpack vue.js

我正在使用Windows上的文档https://vuejs-templates.github.io/webpack中的示例。

很简单:

$ npm install -g vue-cli
$ vue init webpack my-project
$ cd my-project
$ npm install
$ npm run dev

当我运行npm install时,它失败并显示错误:

1715 http fetch GET 200 https://registry.npmjs.org/loose-envify 1ms (from cache)
1716 silly fetchPackageMetaData error for loose-envify@^1.0.0 Unexpected end of input at 1:1370
1716 silly fetchPackageMetaData s":{},"dist":{"shasum":"6b26248c42f6d4fa4b0d8542f78edfcde35642a8","ta
1716 silly fetchPackageMetaData                                                                      ^
1717 verbose stack SyntaxError: Unexpected end of input at 1:1370
1717 verbose stack s":{},"dist":{"shasum":"6b26248c42f6d4fa4b0d8542f78edfcde35642a8","ta

我对js很新。我知道有些软件包无法加载,但我不知道如何处理它。

1 个答案:

答案 0 :(得分:2)

看起来npm缓存了错误的响应。请尝试cleaning the cache

npm cache clean --force