【发布时间】:2019-10-17 01:36:45
【问题描述】:
我刚刚在我的 Mac 上安装了一个 vue 登陆页面。终端到文件夹并正在运行“npm install”和“npm run dev”,它工作得很好。
但在托管服务器上 npm install 有时只是因为它经常被代码 137 杀死。我为项目文件夹创建了一个子域。
运行 npm run start 没有给我任何错误,但 url “subdomain.domain.legal” 在空白页中返回。主要没有被任何东西取代。端口 8080 给出“网站不可用”
您知道托管服务器上的哪些规格或设置可能有问题吗?
index.js
'use strict'
// Template version: 1.3.1
// see http://vuejs-templates.github.io/webpack for documentation.
const path = require('path')
module.exports = {
dev: {
// Paths
assetsSubDirectory: 'static',
assetsPublicPath: '/',
proxyTable: {},
// Various Dev Server settings
host: 'subdomain.domain.legal', // can be overwritten by process.env.HOST
port: 8080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
autoOpenBrowser: true,
errorOverlay: true,
notifyOnErrors: true,
poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions-
// Use Eslint Loader?
// If true, your code will be linted during bundling and
// linting errors and warnings will be shown in the console.
useEslint: true,
// If true, eslint errors and warnings will also be shown in the error overlay
// in the browser.
showEslintErrorsInOverlay: false,
/**
* Source Maps
*/
// https://webpack.js.org/configuration/devtool/#development
devtool: 'cheap-module-eval-source-map',
// If you have problems debugging vue-files in devtools,
// set this to false - it *may* help
// https://vue-loader.vuejs.org/en/options.html#cachebusting
cacheBusting: true,
cssSourceMap: true
},
npm run start 后出错(有时)
I Your application is running here: http://subdomain.domain.legal:8080 Killed
npm ERR! code ELIFECYCLE
npm ERR! errno 137
npm ERR! tovo_vue@1.0.0 dev: `webpack-dev-server --inline --progress --config build/webpack.dev.conf.js`
npm ERR! Exit status 137
npm ERR!
npm ERR! Failed at the tovo_vue@1.0.0 dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /usr/home/user/.npm/_logs/2019-05-31T11_47_21_305Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 137
npm ERR! tovo_vue@1.0.0 start: `npm run dev`
npm ERR! Exit status 137
npm ERR!
npm ERR! Failed at the tovo_vue@1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /usr/home/user/.npm/_logs/2019-05-31T11_47_21_313Z-debug.log
(空白)页面的 HTML 代码
<html><head>
<title>Title</title>
<meta charset="utf-8">
<meta name="author" content="pixelstrap">
<meta name="description" content="xy">
<meta name="keywords" content="xy">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<!-- Fav icon -->
<link rel="shortcut icon" hre="/static/favicon.png">
<!-- Font Family-->
<link href="https://fonts.googleapis.com/css?family=Poppins:300,400,500,600,700" rel="stylesheet">
</head>
<body id="nav-scroller" data-spy="scroll" data-target=".navbar" data-offset="0">
<div id="app"></div>
</body></html>
免费 -g:
total used free shared buff/cache available
Mem: 31 7 10 0 12 22
Swap: 3 0 3
ps 辅助 | grep 节点
user 1422 0.0 0.0 16712 968 pts/1 S+ 14:18 0:00 grep node
【问题讨论】:
-
我们需要看到的不仅仅是这些。代码 137 表示该进程从外部获得了
SIGKILL。 -
是的,我实际上是编码新手,所以请告诉我所有内容,我会尽快添加!
-
在某处上传
/usr/home/user/.npm/_logs/2019-05-31T11_47_21_313Z-debug.log。通常,此问题与oomkiller有关,但有了 10GB 的可用 RAM,这里还有其他问题。
标签: javascript vue.js npm