vue.js - 在 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
解决方案
它可以帮助你:
npm install -g @vue/cli
# OR
yarn global add @vue/cli
推荐阅读
- javascript - 在 C# 中将引号添加到字符串以使其成为 JSON
- google-sheets - 表格右下角缺少求和函数
- reactjs - ReactJS 作为普通 Html
- python-3.x - Flutter 和 Flask REST API 之间的数据解析
- webpack - 由于 CSP 问题,通过 webpack 删除生产代码的 eval()
- swift - 如果在扩展 Swift5.1 Xcode11.3 中声明,子类无法访问便利 init
- git - 当我们 git checkout 提交时会发生什么
- unix - 是否可以限制用户在 SLURM 中可以同时使用的 cpu 数量?
- cookies - 第三方开发人员设置的 SameSite Cookie
- reactjs - 如何使用条件做出反应子组件