• kissyoudyb
    2019-08-23
    > myaccount@1.0.0 build /build/myaccount
    > webpack --progress --colors --config ./webpack.config.js

    sh: webpack: not found
    npm ERR! file sh
    npm ERR! code ELIFECYCLE
    npm ERR! errno ENOENT
    npm ERR! syscall spawn
    npm ERR! myaccount@1.0.0 build: `webpack --progress --colors --config ./webpack.config.js`
    npm ERR! spawn ENOENT
    npm ERR!
    npm ERR! Failed at the myaccount@1.0.0 build 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! /root/.npm/_logs/2019-08-23T07_59_05_753Z-debug.log

    docker-compose build的时候构建 单页应用的时候报错,怎么弄都不行,请老师指点,webpack是不是需要具体哪个版本
    展开

    作者回复: 看起来是webpack没正确安装,应该是前面npm install步骤出问题了,你尝试不用docker-compose,手工本地build是否ok,确保网络安装没有问题。

    如果要运行,你也可以拉我已经打好的镜像:https://hub.docker.com/u/boboweike

     1
     1
  • nzb
    2020-02-07
    hi Successfully built 53a9101d9d97
    Successfully tagged boboweike/web-app:latest
    Building myaccount_service
    Step 1/13 : FROM node:alpine as builder
     ---> b809734bb743
    Step 2/13 : WORKDIR '/build'
     ---> Using cache
     ---> 66ba427ee446
    Step 3/13 : COPY myaccount ./myaccount
     ---> Using cache
     ---> cb6162123250
    Step 4/13 : COPY resources ./resources
     ---> Using cache
     ---> 5b91f5361b2d
    Step 5/13 : COPY third_party ./third_party
     ---> Using cache
     ---> bf01b2b53728
    Step 6/13 : WORKDIR '/build/myaccount'
     ---> Using cache
     ---> c5a7ab46afb8
    Step 7/13 : RUN npm install
     ---> Using cache
     ---> 25dcb9bb407f
    Step 8/13 : RUN npm rebuild node-sass
     ---> Running in 1a5104f56305

    > node-sass@4.12.0 install /build/myaccount/node_modules/node-sass
    > node scripts/install.js

    Downloading binary from https://github.com/sass/node-sass/releases/download/v4.12.0/linux_musl-x64-79_binding.node
    Cannot download "https://github.com/sass/node-sass/releases/download/v4.12.0/linux_musl-x64-79_binding.node":

    HTTP error 404 Not Found
    build的时候报错,试了好几次都是这个错误,请老师指点下
    展开

    作者回复: linux环境?

    https://github.com/sass/node-sass/releases/

    我看了上面的node-sass release,4.12.0这个版本还真没有linux_musl-x64-79_binding.node这个文件。请尝试将frontend项目的package.json中的node-sass依赖版本改为4.13.0或4.13.1,再构建试试。

    
    
  • nzb
    2020-02-06
    hi Service 'myaccount_service' failed to build: Get https://registry-1.docker.io/v2/library/node/manifests/sha256:44ab5111b9cee99c46faca3d5db844983c8d9b6b604bd2a70a9a014c8a0298e0: net/http: TLS handshake timeout 这个老是超时,这个有解决办法么?

    作者回复: 这个错误报告是网络问题,拉不到docker-hub上的镜像,建议凌晨(7点以前)网络比较空闲的时候操作,或者使用一些docker镜像加速器(比如阿里云镜像加速器,需要阿里云账号),或者使用‘科学上网’软件。

    
    
  • 俊杰hope
    2019-12-03
    老师,myaccount-service构建不了,卡在了npm install 中,PhantonJS not found on PATH,然后去下载就会卡住,这个如何解决,单独构建也会卡在这一步。
    PhantomJS not found on PATH
    Downloading https://github.com/Medium/phantomjs/releases/download/v2.1.1/phantomjs-2.1.1-linux-x86_64.tar.bz2
    Saving to /tmp/phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2
    Receiving...
    后面就各种error
    展开

    作者回复: 你好,Staffjoy的前端构建是要求Linux或者Mac环境的,Windows环境暂不支持。如果在Linux或者Mac环境,也要求网络良好,github可以正常访问,因为Staffjoy的前端构建需要到github上下载东西。

    如果是Windows环境,有几个办法可以尝试:

    1. 安装Linux虚拟机(比如用Vagrant),在虚拟机里头构建。
    2. 有学员给出了一个在windows构建的修复方案(https://github.com/spring2go/staffjoy/issues/6),可以尝试下
    3. 跳过构建,直接用波波已经打好的镜像(https://hub.docker.com/u/boboweike),构建实际就是生成静态的html/js文件,然后放在nginx目录下,打成镜像,这步骤理解即可,动手操作并非必须。

    
    
  • 李盛杰
    2019-11-15
    老师 docker-compose能不能一键部署到远程服务器上呢,比如将多个springboot微服务通过docker-compose一键部署到阿里云的一台服务器上

    作者回复: 可以,应该有几种做法可以尝试,一种参考官方文档:
    https://docs.docker.com/compose/production/
    Running Compose on a single server部分,需要设置设置DOCKER环境变量,指向远程主机,远程主机上装有docker host,你本地机器相当于docker client,通过本地docker client操作远程docker host。

    stackoverflow上给出的ssh协议方法也可以尝试,参考:
    https://stackoverflow.com/questions/35433147/how-to-run-docker-compose-on-remote-host

    
    
  • 好好学习
    2019-08-26
    (node:1) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 drain listeners added to [TLSSocket]. Use emitter.setMaxListeners() to increase limit

    作者回复: 我这边暂未出现类似问题,估计和node版本有关,也可能和前端代码有关,我会关注,看具体是什么问题,是否有解决办法。可以参考这个:https://stackoverflow.com/questions/9768444/possible-eventemitter-memory-leak-detected

    
    
我们在线,来聊聊吧