尝试将我的 vue-cli 应用程序部署到 heroku 时遇到了困难

2023-12-24

我已按照以下教程中的具体说明进行操作:

https://codeburst.io/quick-n-clean-way-to-deploy-vue-webpack-apps-on-heroku-b522d3904bc8 https://codeburst.io/quick-n-clean-way-to-deploy-vue-webpack-apps-on-heroku-b522d3904bc8

除了我还没有完成奖金部分。当我尝试在以下位置检查我的应用程序时:

https://git.heroku.com/proto4bkchat.git https://git.heroku.com/proto4bkchat.git

我收到以下错误消息:

Method Not Allowed

通过使用本教程,我只是尝试将 dist 文件夹推送到 heroku。

在过去的几天里我尝试了很多不同的方法,不幸的是我不记得我尝试过的所有方法,我只需要帮助在heroku上部署这个应用程序。

该应用程序适用于开发和生产环境,但不适用于 heroku。

以下是我的存储库的链接:

https://gitlab.com/TitoSalay/BkChatPrototype.git https://gitlab.com/TitoSalay/BkChatPrototype.git

我之前还尝试过使用以下 server.js 文件部署整个根目录:

// server.js
const express = require('express')
const path = require('path')
const history = require('connect-history-api-fallback')

const app = express()

const staticFileMiddleware = express.static(path.join(__dirname + '/dist'))

app.use(staticFileMiddleware)
app.use(history({
  disableDotRule: true,
  verbose: true
}))
app.use(staticFileMiddleware)

app.get('/', function (req, res) {
  res.render(path.join(__dirname + '/dist/index.html'))
})

var server = app.listen(process.env.PORT || 8080, function () {
  var port = server.address().port
  console.log('App now running on port', port)
})

当我使用时:

git push heroku master

我得到以下日志:

Counting objects: 150, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (142/142), done.
Writing objects: 100% (150/150), 3.65 MiB | 544.00 KiB/s, done.
Total 150 (delta 36), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Node.js app detected
remote:
remote: -----> Creating runtime environment
remote:
remote:        NPM_CONFIG_LOGLEVEL=error
remote:        NODE_VERBOSE=false

remote:        NODE_ENV=production
remote:        NODE_MODULES_CACHE=true
remote:
remote: -----> Installing binaries
remote:        engines.node (package.json):  >= 6.0.0
remote:        engines.npm (package.json):   >= 3.0.0
remote:
remote:        Resolving node version >= 6.0.0...
remote:        Downloading and installing node 9.10.1...
remote:        Bootstrapping npm >= 3.0.0 (replacing 5.6.0)...
remote:        npm 5.8.0 installed
remote:
remote: -----> Restoring cache
remote:        Skipping cache restore (not-found)
remote:
remote: -----> Building dependencies
remote:        Installing node modules (package.json + package-lock)
remote:
remote:        > [email protected] /cdn-cgi/l/email-protection install /tmp/build_81bd751efdb3e588f6a9dc1ccc4e3708/node_modules/chromedriver
remote:        > node install.js

remote:        Downloading https://chromedriver.storage.googleapis.com/2.37/chromedriver_linux64.zip
remote:        Saving to /tmp/chromedriver/chromedriver_linux64.zip
remote:        Received 781K...
remote:        Received 1568K...
remote:        Received 2352K...
remote:        Received 3136K...
remote:        Received 3632K total.
remote:        Extracting zip contents
remote:        Copying to target path /tmp/build_81bd751efdb3e588f6a9dc1ccc4e3708/node_modules/chromedriver/lib/chrom
edriver
remote:        Fixing file permissions
remote:        Done. ChromeDriver binary available at /tmp/build_81bd751efdb3e588f6a9dc1ccc4e3708/node_modules/chrome
driver/lib/chromedriver/chromedriver
remote:
remote:        > [email protected] /cdn-cgi/l/email-protection postinstall /tmp/build_81bd751efdb3e588f6a9dc1ccc4e3708/node_modules/w

ebpack/node_modules/uglifyjs-webpack-plugin
remote:        > node lib/post_install.js
remote:
remote:        added 1249 packages from 969 contributors in 24.841s
remote:
remote: -----> Caching build
remote:        Clearing previous node cache
remote:        Saving 2 cacheDirectories (default):
remote:        - node_modules
remote:        - bower_components (nothing to cache)
remote:
remote: -----> Pruning devDependencies
remote:        removed 1197 packages in 12.146s
remote:
remote: -----> Build succeeded!
remote: -----> Discovering process types
remote:        Procfile declares types     -> (none)
remote:        Default types for buildpack -> web
remote:
remote: -----> Compressing...
remote:        Done: 20.9M
remote: -----> Launching...
remote:        Released v3
remote:        https://proto4bkchat.herokuapp.com/ deployed to Heroku
remote:
remote: Verifying deploy... done.
To https://git.heroku.com/proto4bkchat.git
 * [new branch]      master -> master

当我使用时:

git subtree push --prefix dist heroku master

我收到以下消息:

No new revisions were found

我的程序文件:

web: node server.js

UPDATE:

我现在使用:

heroku open

我现在收到以下错误消息:

Cannot GET /

当我运行 heroku log --tail 时,我得到以下信息:

2018-04-04T14:27:59.000000+00:00 app[api]: Build started by user [email protected] /cdn-cgi/l/email-protection
2018-04-04T14:29:00.808932+00:00 app[api]: Release v3 created by user [email protected] /cdn-cgi/l/email-protection
2018-04-04T14:29:00.808932+00:00 app[api]: Deploy 940fed7d by user [email protected] /cdn-cgi/l/email-protection
2018-04-04T14:29:00.827808+00:00 app[api]: Scaled to web@1:Free by user [email protected] /cdn-cgi/l/email-protection
2018-04-04T14:27:59.000000+00:00 app[api]: Build succeeded
2018-04-04T14:29:04.680780+00:00 heroku[web.1]: Starting process with command `npm start`
2018-04-04T14:29:07.017006+00:00 app[web.1]: > [email protected] /cdn-cgi/l/email-protection start /app
2018-04-04T14:29:07.017009+00:00 app[web.1]: > node server.js
2018-04-04T14:29:07.016979+00:00 app[web.1]:
2018-04-04T14:29:07.235631+00:00 app[web.1]: App now running on port 16727
2018-04-04T14:29:07.017011+00:00 app[web.1]:
2018-04-04T14:29:08.314843+00:00 heroku[web.1]: State changed from starting to up
2018-04-04T14:29:09.911216+00:00 heroku[router]: at=info method=GET path="/" host=proto4bkchat.herokuapp.com request_
id=7e0e470c-4edd-45eb-96a1-876e1127b6f1 fwd="94.193.229.163" dyno=web.1 connect=0ms service=34ms status=404 bytes=383
 protocol=https

2018-04-04T14:29:09.902613+00:00 app[web.1]: Rewriting GET / to /index.html
2018-04-04T14:29:10.178203+00:00 heroku[router]: at=info method=GET path="/favicon.ico" host=proto4bkchat.herokuapp.c
om request_id=34efa313-9344-4e84-99f2-ce5a185c2308 fwd="94.193.229.163" dyno=web.1 connect=0ms service=3ms status=404
 bytes=394 protocol=https
2018-04-04T14:29:10.177004+00:00 app[web.1]: Rewriting GET /favicon.ico to /index.html
2018-04-04T14:33:34.284154+00:00 heroku[router]: at=info method=GET path="/favicon.ico" host=proto4bkchat.herokuapp.c
om request_id=0bc35e22-d798-4728-93a6-e3392949925b fwd="94.193.229.163" dyno=web.1 connect=0ms service=3ms status=404
 bytes=394 protocol=https
2018-04-04T14:33:34.281911+00:00 app[web.1]: Rewriting GET /favicon.ico to /index.html
2018-04-04T14:37:02.733412+00:00 app[web.1]: Rewriting GET / to /index.html
2018-04-04T14:37:02.734756+00:00 heroku[router]: at=info method=GET path="/" host=proto4bkchat.herokuapp.com request_
id=27e3f301-d6cb-484c-bc3c-108771c16da2 fwd="94.193.229.163" dyno=web.1 connect=2ms service=4ms status=404 bytes=383
protocol=https
2018-04-04T14:38:10.000000+00:00 app[api]: Build started by user [email protected] /cdn-cgi/l/email-protection
2018-04-04T14:39:06.403176+00:00 heroku[web.1]: Restarting
2018-04-04T14:39:06.403176+00:00 heroku[web.1]: State changed from up to starting
2018-04-04T14:39:06.128567+00:00 app[api]: Deploy 9f5cc557 by user [email protected] /cdn-cgi/l/email-protection
2018-04-04T14:39:06.128567+00:00 app[api]: Release v4 created by user [email protected] /cdn-cgi/l/email-protection
2018-04-04T14:39:06.960489+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2018-04-04T14:39:07.062481+00:00 heroku[web.1]: Process exited with status 143
2018-04-04T14:39:09.641745+00:00 heroku[web.1]: Starting process with command `npm start`
2018-04-04T14:39:13.212697+00:00 app[web.1]:

2018-04-04T14:39:13.212716+00:00 app[web.1]: > [email protected] /cdn-cgi/l/email-protection start /app
2018-04-04T14:39:13.212718+00:00 app[web.1]: > node server.js
2018-04-04T14:39:13.212719+00:00 app[web.1]:
2018-04-04T14:39:13.816340+00:00 app[web.1]: App now running on port 55452
2018-04-04T14:39:14.207455+00:00 heroku[web.1]: State changed from starting to up
2018-04-04T14:38:10.000000+00:00 app[api]: Build succeeded
2018-04-04T14:39:38.113879+00:00 heroku[router]: at=info method=GET path="/" host=proto4bkchat.herokuapp.com request_
id=32acfc35-dd8d-4f15-9246-5c4ddb844f5f fwd="94.193.229.163" dyno=web.1 connect=1ms service=96ms status=404 bytes=383
 protocol=https
2018-04-04T14:39:38.099335+00:00 app[web.1]: Rewriting GET / to /index.html
2018-04-04T14:42:22.977451+00:00 heroku[web.1]: State changed from up to down
2018-04-04T14:42:24.124802+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2018-04-04T14:42:24.239322+00:00 heroku[web.1]: Process exited with status 143
2018-04-04T14:42:22.807668+00:00 app[api]: Rollback to v1 by user [email protected] /cdn-cgi/l/email-protection
2018-04-04T14:42:22.807668+00:00 app[api]: Release v5 created by user [email protected] /cdn-cgi/l/email-protection

2018-04-04T20:34:52.103810+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/
" host=proto4bkchat.herokuapp.com request_id=43e0e34b-c25b-443b-8de2-69de9bada2a6 fwd="94.193.229.163" dyno= connect=
 service= status=503 bytes= protocol=https
2018-04-04T20:41:02.000000+00:00 app[api]: Build started by user [email protected] /cdn-cgi/l/email-protection
2018-04-04T20:42:05.567081+00:00 app[api]: Release v6 created by user [email protected] /cdn-cgi/l/email-protection
2018-04-04T20:42:05.567081+00:00 app[api]: Deploy bc9ece25 by user [email protected] /cdn-cgi/l/email-protection
2018-04-04T20:42:07.826536+00:00 heroku[web.1]: Starting process with command `npm start`
2018-04-04T20:41:02.000000+00:00 app[api]: Build succeeded
2018-04-04T20:42:05.591139+00:00 app[api]: Scaled to web@1:Free by user [email protected] /cdn-cgi/l/email-protection
2018-04-04T20:42:09.960096+00:00 app[web.1]:
2018-04-04T20:42:09.960114+00:00 app[web.1]: > [email protected] /cdn-cgi/l/email-protection start /app
2018-04-04T20:42:09.960117+00:00 app[web.1]: > node server.js
2018-04-04T20:42:09.960118+00:00 app[web.1]:
2018-04-04T20:42:10.309937+00:00 app[web.1]: App now running on port 46237
2018-04-04T20:42:10.526656+00:00 heroku[web.1]: State changed from starting to up
2018-04-04T20:42:13.766514+00:00 heroku[router]: at=info method=GET path="/" host=proto4bkchat.herokuapp.com request_
id=cf616fb3-2231-4ba3-b877-7fe6937a1122 fwd="94.193.229.163" dyno=web.1 connect=1ms service=63ms status=404 bytes=383
 protocol=https
2018-04-04T20:42:13.759011+00:00 app[web.1]: Rewriting GET / to /index.html
2018-04-04T20:45:37.000000+00:00 app[api]: Build started by user [email protected] /cdn-cgi/l/email-protection
2018-04-04T20:46:34.265829+00:00 heroku[web.1]: Restarting
2018-04-04T20:46:34.268319+00:00 heroku[web.1]: State changed from up to starting
2018-04-04T20:46:33.895581+00:00 app[api]: Release v7 created by user [email protected] /cdn-cgi/l/email-protection
2018-04-04T20:46:33.895581+00:00 app[api]: Deploy a606c93e by user [email protected] /cdn-cgi/l/email-protection
2018-04-04T20:45:37.000000+00:00 app[api]: Build succeeded
2018-04-04T20:46:34.894801+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2018-04-04T20:46:34.969267+00:00 heroku[web.1]: Process exited with status 143
2018-04-04T20:46:36.179255+00:00 heroku[web.1]: Starting process with command `npm start`
2018-04-04T20:46:37.895380+00:00 app[web.1]:
2018-04-04T20:46:37.895400+00:00 app[web.1]: > [email protected] /cdn-cgi/l/email-protection start /app
2018-04-04T20:46:37.895402+00:00 app[web.1]:
2018-04-04T20:46:37.895401+00:00 app[web.1]: > node server.js
2018-04-04T20:46:38.111326+00:00 app[web.1]: App now running on port 24497
2018-04-04T20:46:38.504681+00:00 heroku[web.1]: State changed from starting to up
2018-04-04T20:46:42.928331+00:00 heroku[router]: at=info method=GET path="/" host=proto4bkchat.herokuapp.com request_
id=a23b2bfc-9504-412e-8c5f-2b15934a6f6c fwd="94.193.229.163" dyno=web.1 connect=0ms service=23ms status=404 bytes=383
 protocol=https

2018-04-04T20:46:42.921010+00:00 app[web.1]: Rewriting GET / to /index.html
2018-04-04T20:48:26.000000+00:00 app[api]: Build started by user [email protected] /cdn-cgi/l/email-protection
2018-04-04T20:49:24.592773+00:00 heroku[web.1]: Restarting
2018-04-04T20:49:24.596433+00:00 heroku[web.1]: State changed from up to starting
2018-04-04T20:49:25.543655+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2018-04-04T20:49:25.647753+00:00 heroku[web.1]: Process exited with status 143
2018-04-04T20:49:26.885447+00:00 heroku[web.1]: Starting process with command `node server.js`
2018-04-04T20:48:26.000000+00:00 app[api]: Build succeeded
2018-04-04T20:49:23.562941+00:00 app[api]: Deploy 1d056fa4 by user [email protected] /cdn-cgi/l/email-protection
2018-04-04T20:49:23.562941+00:00 app[api]: Release v8 created by user [email protected] /cdn-cgi/l/email-protection
2018-04-04T20:49:29.013716+00:00 app[web.1]: App now running on port 48709
2018-04-04T20:49:30.529718+00:00 heroku[web.1]: State changed from starting to up
2018-04-04T20:50:06.138034+00:00 heroku[router]: at=info method=GET path="/" host=proto4bkchat.herokuapp.com request_
id=605247f4-cc6b-498f-bcd6-20b4c1c1fa6e fwd="94.193.229.163" dyno=web.1 connect=1ms service=24ms status=404 bytes=383
 protocol=https
2018-04-04T20:50:06.127297+00:00 app[web.1]: Rewriting GET / to /index.html
2018-04-04T20:54:51.000000+00:00 app[api]: Build started by user [email protected] /cdn-cgi/l/email-protection
2018-04-04T20:55:49.316717+00:00 app[api]: Release v9 created by user [email protected] /cdn-cgi/l/email-protection
2018-04-04T20:55:49.316717+00:00 app[api]: Deploy 346e97a0 by user [email protected] /cdn-cgi/l/email-protection
2018-04-04T20:55:49.557030+00:00 heroku[web.1]: Restarting
2018-04-04T20:55:49.557620+00:00 heroku[web.1]: State changed from up to starting

2018-04-04T20:54:51.000000+00:00 app[api]: Build succeeded
2018-04-04T20:55:53.163175+00:00 heroku[web.1]: Starting process with command `node server.js`
2018-04-04T20:55:56.158535+00:00 app[web.1]: App now running on port 54343
2018-04-04T20:55:57.009235+00:00 heroku[web.1]: State changed from starting to up
2018-04-04T20:55:58.573480+00:00 heroku[router]: at=info method=GET path="/" host=proto4bkchat.herokuapp.com request_
id=978a1543-d080-4f10-84ca-6e7f25b3704e fwd="94.193.229.163" dyno=web.1 connect=1ms service=106ms status=404 bytes=38
3 protocol=https
2018-04-04T20:55:58.555396+00:00 app[web.1]: Rewriting GET / to /index.html
2018-04-04T20:56:09.104025+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2018-04-04T20:56:09.168587+00:00 heroku[web.1]: Process exited with status 143

该应用程序似乎根据此日志构建 dist 文件夹时出现问题:

2018-04-04T22:25:30.208992+00:00 app[api]: Initial release by user [email protected] /cdn-cgi/l/email-protection
2018-04-04T22:25:30.208992+00:00 app[api]: Release v1 created by user [email protected] /cdn-cgi/l/email-protection
2018-04-04T22:25:30.655267+00:00 app[api]: Release v2 created by user [email protected] /cdn-cgi/l/email-protection
2018-04-04T22:25:30.655267+00:00 app[api]: Enable Logplex by user [email protected] /cdn-cgi/l/email-protection
2018-04-04T22:34:17.000000+00:00 app[api]: Build started by user [email protected] /cdn-cgi/l/email-protection
2018-04-04T22:34:17.000000+00:00 app[api]: Build failed -- check your build logs
2018-04-04T22:35:26.000000+00:00 app[api]: Build started by user [email protected] /cdn-cgi/l/email-protection
2018-04-04T22:35:26.000000+00:00 app[api]: Build failed -- check your build logs
2018-04-04T22:36:26.000000+00:00 app[api]: Build started by user [email protected] /cdn-cgi/l/email-protection

2018-04-04T22:36:26.000000+00:00 app[api]: Build failed -- check your build logs
2018-04-04T22:39:35.000000+00:00 app[api]: Build started by user [email protected] /cdn-cgi/l/email-protection
2018-04-04T22:39:35.000000+00:00 app[api]: Build failed -- check your build logs
2018-04-04T22:50:07.000000+00:00 app[api]: Build started by user [email protected] /cdn-cgi/l/email-protection
2018-04-04T22:51:08.581397+00:00 app[api]: Release v3 created by user [email protected] /cdn-cgi/l/email-protection
2018-04-04T22:50:07.000000+00:00 app[api]: Build succeeded
2018-04-04T22:51:08.581397+00:00 app[api]: Deploy 2e21be42 by user [email protected] /cdn-cgi/l/email-protection
2018-04-04T22:51:08.606000+00:00 app[api]: Scaled to web@1:Free by user [email protected] /cdn-cgi/l/email-protection
2018-04-04T22:51:11.160323+00:00 heroku[web.1]: Starting process with command `node server.js`
2018-04-04T22:51:13.445374+00:00 app[web.1]: App now running on port 56629
2018-04-04T22:51:15.029609+00:00 heroku[web.1]: State changed from starting to up
2018-04-04T22:53:04.169972+00:00 heroku[router]: at=info method=GET path="/" host=bkchatproto.herokuapp.com request_i
d=c554f1dc-c588-45e1-aa71-24f11bbab0f6 fwd="94.193.229.163" dyno=web.1 connect=0ms service=31ms status=404 bytes=383
protocol=http
2018-04-04T22:53:04.155705+00:00 app[web.1]: Rewriting GET / to /index.html
2018-04-04T22:53:04.429826+00:00 heroku[router]: at=info method=GET path="/favicon.ico" host=bkchatproto.herokuapp.co
m request_id=23e9f92a-3633-4ba0-b5d6-28d2a0e98ece fwd="94.193.229.163" dyno=web.1 connect=1ms service=3ms status=404
bytes=394 protocol=http
2018-04-04T22:53:04.427800+00:00 app[web.1]: Rewriting GET /favicon.ico to /index.html
2018-04-04T22:55:17.562456+00:00 heroku[router]: at=info method=GET path="/" host=proto4bkchat.herokuapp.com request_
id=7194aade-9ca5-4613-bf28-84f6d239b7d4 fwd="94.193.229.163" dyno=web.1 connect=258ms service=30ms status=404 bytes=3
83 protocol=https
bkchat_proto1/package.json12:33
LFUTF-8JSON0 files1 update

所以我在 package.json 中尝试了以下内容:

{
  "name": "bkchat_proto1",
  "version": "1.0.0",
  "description": "Bkchat website prototype",
  "author": "Christopher Salay",
  "private": true,
  "scripts": {
    "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js",
    "e2e": "node test/e2e/runner.js",
    "test": "npm run e2e",
    "build": "node build/build.js",
    "postinstall":"npm install && npm run build"
  },
  "dependencies": {
    "connect-history-api-fallback": "^1.5.0",
    "express": "^4.16.3",
    "serve-static": "^1.13.2",
    "vue": "^2.5.2",
    "vue-router": "^3.0.1"
  },
  "devDependencies": {
    "autoprefixer": "^7.1.2",
    "babel-core": "^6.22.1",
    "babel-helper-vue-jsx-merge-props": "^2.0.3",
    "babel-loader": "^7.1.1",
    "babel-plugin-syntax-jsx": "^6.18.0",
    "babel-plugin-transform-runtime": "^6.22.0",
    "babel-plugin-transform-vue-jsx": "^3.5.0",
    "babel-preset-env": "^1.3.2",
    "babel-preset-stage-2": "^6.22.0",
    "babel-register": "^6.22.0",
    "chalk": "^2.0.1",
    "chromedriver": "^2.27.2",
    "copy-webpack-plugin": "^4.0.1",
    "cross-spawn": "^5.0.1",
    "css-loader": "^0.28.0",
    "extract-text-webpack-plugin": "^3.0.0",
    "file-loader": "^1.1.4",
    "friendly-errors-webpack-plugin": "^1.6.1",
    "html-webpack-plugin": "^2.30.1",
    "nightwatch": "^0.9.12",
    "node-notifier": "^5.1.2",
    "optimize-css-assets-webpack-plugin": "^3.2.0",
    "ora": "^1.2.0",
    "portfinder": "^1.0.13",
    "postcss-import": "^11.0.0",
    "postcss-loader": "^2.0.8",
    "postcss-url": "^7.2.1",
    "rimraf": "^2.6.0",
    "selenium-server": "^3.0.1",
    "semver": "^5.3.0",
    "shelljs": "^0.7.6",
    "uglifyjs-webpack-plugin": "^1.1.1",
    "url-loader": "^0.5.8",
    "vue-loader": "^13.3.0",
    "vue-style-loader": "^3.0.1",
    "vue-template-compiler": "^2.5.2",
    "webpack": "^3.6.0",
    "webpack-bundle-analyzer": "^2.9.0",
    "webpack-dev-server": "^2.9.1",
    "webpack-merge": "^4.1.0"
  },
  "engines": {
    "node": ">= 6.0.0",
    "npm": ">= 3.0.0"
  },
  "browserslist": [
    "> 1%",
    "last 2 versions",
    "not ie <= 8"
  ]
}

我正在尝试安装所有依赖项并构建 dist 文件夹,但是当我将其推送到 heroku 时,它会创建一个不断重复自身的进程,并且尽管我尝试通过 heroku cli 停止该进程,但它不会停止。 这个过程似乎也没有结束,所以我通常被迫销毁应用程序并再次创建它。

我还在我的 Procfile 中尝试了以下操作:

web: npm install
web: npm run build
web: node server.js

这次构建也失败了。


没关系,昨晚我找到了解决方案。我在 package.json 文件的脚本部分下添加了 "heroku-postinstall": "npm install && npm run build" 以使其正常工作。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

尝试将我的 vue-cli 应用程序部署到 heroku 时遇到了困难 的相关文章

  • 如何使用 selenium 和 Mocha 获取 xPath() 选择的锚标记的文本

    我已经成功选择了 a 标签 我想显示锚标记的文本 但无法这样做 我正在使用 selenium mocha javascript 和 phantomJS 这是我的脚本 详细 var assert require assert var test
  • 如何在ASP.NET Webform中使用Jquery表单插件?

    我遇到了这个插件 http malsup com jquery form getting started http malsup com jquery form getting started 我想知道如何在 ASP NET WebForm
  • 如何使用 JavaScript 中的值填充下拉列表?

    我在 Tridion CMS 扩展中的功能区工具栏按钮中添加了一个按钮 单击该按钮后 将显示一个弹出页面 其中包含两个下拉菜单 通过更改第一个下拉控件中的值 我应该填充第二个下拉控件的值 就我而言 我正在使用ASP drop down li
  • 如何按照编写的顺序迭代 javascript 对象属性

    我发现了代码中的一个错误 我希望通过最少的重构工作来解决该错误 此错误发生在 Chrome 和 Opera 浏览器中 问题 var obj 23 AA 12 BB iterating through obj s properties for
  • 即使我可以监视其他方法,也无法监视事件处理程序

    我想使用 Jest Jasmine Enzyme 测试 React 中的事件处理程序 MyComponent js import React from react class MyComponent extends React Compon
  • 是否可以使用 javascript 测试用户的浏览器/操作系统是否支持给定类型的链接?

    是否可以使用 javascript 或其他任何东西 测试用户的操作系统 浏览器是否支持给定的 url 方案 例如 大多数仅使用网络邮件的用户计算机上未设置 mailto 是否有可能以某种方式捕获单击 mailto 链接的尝试并弹出比浏览器错
  • git 是否有任何静态接口?

    我一直在寻找一个宁静的 git api 但似乎没有找到 我得到的最接近的是 Github 的 api 来访问一些存储库信息 还有其他的实施吗 Orion Git API http wiki eclipse org Orion Server
  • JavaScript 中数组的 HTML 数据列表值

    我有一个简单的程序 它必须从服务器上的文本文件中获取值 然后将数据列表填充为输入文本字段中的选择 为此 我想要采取的第一步是我想知道如何动态地将 JavaScript 数组用作数据列表选项 我的代码是
  • Javascript - 将值从下拉框传递到 Google Maps API

    我正在使用 Google 地图 API 为一家出租车公司创建报价表 目前 用户在 2 个文本框中输入出发点和接载点 API 会计算两点之间的距离以及行程费用 我正在尝试添加两个具有设定位置的下拉框 以便用户可以选择这些位置之一或使用文本框输
  • IE11不监听MSFullscreenChange事件

    我正在尝试使用 Bigscreen js 在 IE11 中使用全屏 但 IE11 不监听 MS FullscreenChange 事件 document addEventListener MSFullscreenChange functio
  • vue-test-utils:如何测试 Mounted() 生命周期挂钩中的逻辑(使用 vuex)?

    我正在尝试为 Vue 中的逻辑编写一个单元测试mounted 生命周期钩子 但运气不太好 问题似乎是这样的mounted 使用 vue test utils 安装组件时永远不会被调用mount 这是我要测试的 Vue 组件
  • git merge 冲突的不同场景

    我试图了解 git 合并后可能发生 git 冲突的情况以及如何避免它们 我创建了一个 git 存储库并向其中添加了一个文本文件 我已将 1 添加到文本文件中并将其提交给 master 我已经从 master 创建了一个新分支 分支 2 并将
  • 如何将函数内的捕获错误传递给父级

    我有这几行代码示例 想知道下面的逻辑到底如何 try var response child console log why here catch err console log should show this err function c
  • 数据表日期范围过滤器

    如何添加日期范围过滤器 like From To 我开始进行常规搜索和分页等工作 但我不知道如何制作日期范围过滤器 我正在使用数据表 1 10 11 版本 My code var oTable function callFilesTable
  • 如何在 Google 地图 V3 中创建编号地图标记?

    我正在制作一张上面有多个标记的地图 这些标记使用自定义图标 但我还想在顶部添加数字 我已经了解了如何使用旧版本的 API 来实现这一点 我怎样才能在V3中做到这一点 注意 当您将鼠标悬停在标记上时 标题 属性会创建一个工具提示 但我希望即使
  • 单击引导分页链接时调用 jquery 函数

    我想在单击引导分页链接时调用 jquery 函数 假设我想从第1页遍历到第2页 应该调用一个jquery函数 我正在使用以下代码 但它不起作用 ul pagination on click li function alert page ch
  • 需要有关 React Js 的帮助

    我是 React Js 新手 我的代码无法正常工作 请看下面 这是我的脚本文件Main jsx 该文件由 React 编译 输出放置在 dist 文件夹下的 main js 文件中 var react require react react
  • 如何在打字稿文件中导入没有定义文件的js库

    随着我们的项目变得越来越大 我想从 JavaScript 切换到 TypeScript 以帮助进行代码管理 然而 我们使用许多库作为 amd 模块 我们不想将其转换为 TypeScript 我们仍然想将它们导入 TypeScript 文件
  • 如何在 gulp.src 中使用基本正则表达式?

    我正在尝试选择两个文件gulp src highcharts js and highcharts src js 当然 我知道我可以使用数组表达式显式添加这两个表达式 但出于学习目的 我尝试为它们编写一个表达式 我读过可以使用简单的正则表达式
  • KeyboardAvoidingView - 隐藏键盘时重置高度

    我正在使用 React NativeKeyboardAvoidingView设置我的高度View当显示键盘时 但是当我关闭应用程序中的键盘时 视图的高度不会变回原来的值

随机推荐