"ERROR command failed: npm install --loglevel error" 尝试做 "vue create"

"ERROR command failed: npm install --loglevel error" when trying to do "vue create"

Vue CLI v3.2.1
✨  Creating project in /home/mcaubrey511/portfolio.
  Initializing git repository...
⚙  Installing CLI plugins. This might take a while...


> yorkie@2.0.0 install /home/mcaubrey511/portfolio/node_modules/yorkie
> node bin/install.js


ERROR  command failed: npm install --loglevel error

环境信息

系统:

OS: Linux 4.18 Ubuntu 18.10 (宇宙墨鱼)

CPU:(1) x64 Intel(R) Xeon(R) CPU @ 2.30GHz

二进制文件:

节点:10.14.1 - /usr/bin/node

npm:6.4.1 - /usr/bin/npm

npm 包:

@vue/babel-preset-app: 3.2.0

@vue/cli-overlay: 3.2.0

@vue/cli-plugin-babel: ^3.2.0 => 3.2.0

@vue/cli-plugin-eslint: ^3.2.0 => 3.2.1

@vue/cli-service: ^3.2.0 => 3.2.0

@vue/cli-shared-utils: 3.2.0

@vue/component-compiler-utils: 2.3.0

@vue/preload-webpack-plugin: 1.1.0

@vue/web-component-wrapper: 1.2.0

babel-helper-vue-jsx-merge-props: 2.0.3

babel-plugin-transform-vue-jsx: 4.0.1

eslint-plugin-vue: 4.7.1

vue-eslint-解析器:2.0.3

vue-hot-reload-api: 2.3.1

vue-loader: 15.4.2

vue-style-loader: 4.1.2

vue-template-es2015-编译器:1.6.0

npmGlobalPackages:

@vue/cli: 3.2.1


知道哪里出了问题或者我可以做些什么来让它工作吗?

将我使用的机器切换到 Ubuntu 18.04 LTS 后,我不再遇到问题。我制作了 an issue on the vue-cli 存储库,似乎至少有一个人遇到了类似的问题,但环境不同。

如果在安装 vue/cli 之前在终端中执行 apt-get update,问题将得到解决。

简而言之,apt-get update 实际上并没有安装新版本的软件。相反,它会更新需要升级的包的升级包列表,以及刚刚进入存储库的新包。

apt-get update downloads the package lists from the repositories and "updates" them to get information on the newest versions of packages and their dependencies. It will do this for all repositories and PPAs.