首页 > 解决方案 > 在 vue 应用程序中运行“npm run build”时出错

问题描述

我已经从 git hub ( https://github.com/jimmerioles/progressive-weather-app ) 克隆了 vue 应用程序,用于在 jenkins 中自动部署。在此之前,我正在检查我的 ubuntu 机器(GCP vm)。我在那里安装了 java、nodejs、npm 和 vuecli。当我执行命令“npm run build”时出现以下错误。我也尝试重新安装 vuecli、nodejs 和 npm。,仍然得到同样的错误。请让我知道我该如何解决这个问题。

npm 版本是“6.2.0”,nodejs 版本是“v14.3.0”,vuecli 是最新版本。

root@instance-2:~/weather/src# npm run build
> PWeatherApp@0.1.0 build /root/weather
> vue-cli-service build
sh: 1: vue-cli-service: not found
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! PWeatherApp@0.1.0 build: `vue-cli-service build`
npm ERR! spawn ENOENT
npm ERR! 
npm ERR! Failed at the PWeatherApp@0.1.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output 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!     /root/.npm/_logs/2020-05-23T18_32_20_092Z-debug.log

标签: vue.jsvuejs2vue-component

解决方案


它可以帮助你:

npm install -g @vue/cli
# OR
yarn global add @vue/cli

推荐阅读