Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

部署完打不开 #1

Open
zhenglin305 opened this issue Nov 10, 2020 · 3 comments
Open

部署完打不开 #1

zhenglin305 opened this issue Nov 10, 2020 · 3 comments

Comments

@zhenglin305
Copy link

zhenglin305 commented Nov 10, 2020

部署完打开htttp://ip:8081 提示404 Not Found怎么搞?
我看nginx配置/admin转到 /opt/www/dist,然而opt/www/下根本没有dist目录

@vbigbang
Copy link

我也遇到了 应该是打包的时候出问题了 你可以看看容器的日志

@JoeXiong
Copy link

JoeXiong commented Feb 5, 2021

同样遇到,执行容器日志看到:

% docker logs -f  alarm-dog_fe_1
yarn config v1.22.4
success Set "registry" to "https://registry.npm.taobao.org".
Done in 0.08s.
yarn run v1.22.4
$ vue-cli-service build
/bin/sh: vue-cli-service: not found
error Command failed with exit code 127.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

yarn-error.log

Arguments: 
  /usr/local/bin/node /opt/yarn-v1.22.4/bin/yarn.js install

PATH: 
  /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

Yarn version: 
  1.22.4

Node version: 
  12.18.4

Platform: 
  linux x64

Trace: 
  Error: ENOENT: no such file or directory, copyfile '/usr/local/share/.cache/yarn/v6/npm-@types-node-13.7.7-1628e6461ba8cc9b53196dfeaeec7b07fa6eea99-integrity/node_modules/@types/node/ts3.2/globals.d.ts' -> '/opt/www/node_modules/@types/node/ts3.2/globals.d.ts'

@JoeXiong
Copy link

JoeXiong commented Feb 5, 2021

进入容器:docker exec -it alarm-dog_fe_1 /bin/bash
执行:yarn install
再执行: yarn build

....
  dist/static/css/chunk-a9c627b4.d558187    0.13 KiB         0.11 KiB
  c.css
  dist/static/css/chunk-f83072aa.d558187    0.13 KiB         0.11 KiB
  c.css

  Images and other types of assets omitted.

 DONE  Build complete. The dist directory is ready to be deployed.
 INFO  Check out deployment instructions at https://cli.vuejs.org/guide/deployment.html
                                  
Done in 101.96s.

成功构建

怀疑是否是docker执行 yarn install 下载依赖包不完整导致构建失败

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants