Tag: node.js

docker中npm更新失败

我不能更新docker中的npm package xxx npm update -g 要么 npm install -g xxx 更新后,我不能执行xxx,并抛出 Error: Cannot find module 'semver' 所以我必须要 npm uninstall -g xxx npm install -g xxx 每次我想更新软件包时重新安装。 如何更新docker中的npm包?

由于ubuntu的未满足的依赖关系,无法安装节点6的npm

这是错误消息: Step 6/10 : RUN apt-get install -y npm —> Running in 85acc9ae3f0d Reading package lists… Building dependency tree… Reading state information… Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created […]

在docker集装箱中使用快递与快递

我开发了一个带有节点js的API,为fileUploaderexpression和修改。 一切工作在我的电脑本地,但是当我尝试部署在我的服务器上的docker容器上的上传文件不起作用。 我没有错误,在我的客户端POST请求返回成功200没有错误,但是当我把巴赫附加到我的容器,文件不存在… Dockerfile: FROM node:boron # Create app directory RUN mkdir -p /usr/src/app WORKDIR /usr/src/app # Install app dependencies COPY package.json /usr/src/app/ RUN npm install # Bundle app source COPY . /usr/src/app RUN mkdir public RUN mkdir public/img EXPOSE 8085 CMD [ "npm", "start" ] Multer Conf: // Upload dir for img var storage […]

Ethercalc不在Docker和c9.io上启动

每当我尝试使用docker或c9.io(ubuntu实例)启动ethercalc。 它不工作,并抛出一个错误,如下所示。 但它在本地运行没有任何问题在Mac。 ethercalc Please connect to: http://a36thninja-ether-4985966:8080/ Starting backend using webworker-threads /home/ubuntu/.nvm/versions/node/v4.6.1/lib/node_modules/ethercalc/node_modules/nodemailer/lib/mailer/index.js:31 compile: [(…args) => this._convertDataImages(…args)], ^^^ SyntaxError: Unexpected token … at exports.runInThisContext (vm.js:53:16) at Module._compile (module.js:373:25) at Object.Module._extensions..js (module.js:416:10) at Module.load (module.js:343:32) at Function.Module._load (module.js:300:12) at Module.require (module.js:353:17) at require (internal/module.js:12:17) at Object.<anonymous> (/home/ubuntu/.nvm/versions/node/v4.6.1/lib/node_modules/ethercalc/node_modules/nodemailer/lib/nodemailer.js:3:16) at Module._compile (module.js:409:26) at Object.Module._extensions..js (module.js:416:10) at Module.load (module.js:343:32) […]

如何使用Shell脚本重新启动Docker服务

我有在Docker容器中运行的Node服务 由于以下exception服务会在一段时间后停止。 events.js:141 throw er; // Unhandled 'error' event Error: read ECONNRESET at exports._errnoException (util.js:870:11) at TLSWrap.onread (net.js:544:26) 我不知道为什么这个例外即将到来。 我正在寻找可以重新启动服务的工作。 我正在使用shell文件来运行这些服务,所以有什么我可以添加在shell文件,可以重新启动这个停止的服务。 以下是我的shell文件的示例: #!/bin/bash ORGANISATION="$1" SERVICE_NAME="$2" VERSION="$3" ENVIRONMENT="$4" INTERNAL_PORT_NUMBER="$5" EXTERNAL_PORT_NUMBER="$6" NETWORK="$7" docker build -t ${ORGANISATION}/${SERVICE_NAME}:${VERSION} –build-arg PORT=${INTERNAL_PORT_NUMBER} –build-arg ENVIRONMENT=${ENVIRONMENT} –no-cache . docker stop ${SERVICE_NAME} docker rm ${SERVICE_NAME} sudo npm install sudo npm install -g express docker […]

在Windows上找不到monax命令

我想安装和configurationMonax的工作在这个链接的窗口: https ://monax.io/docs/getting-started/,但由于某种原因,当我在命令行键入monax无法从git bash或cmd识别。 我想运行这个命令monax init来下载less量的docker镜像。 我已经安装了Docker工具并下载了Monax二进制文件,但是我不知道在哪里放这些二进制文件。 通过从发布页面下载Docker Toolbox和Monax二进制文件,安装Docker,Docker Machine和VirtualBox。 确保将二进制文件放在%PATH%variables中的某个path下。 最后一个陈述我有问题理解请确保您将二进制在您的%PATH%variables的path之一。 任何帮助,将不胜感激!

pm2不启动服务器上的应用程序进程configuration加载失败

我无法启动DigitalOcean(CentOS7)上的PM2, [PM2] Process config loading failed [] 完整的命令.. bash-4.3# pm2 start ecosystem.config.js –env production [PM2][WARN] You are starting -1 processes in fork_mode without load balancing. To enable it remove -x option. [PM2][WARN] Applications api not running, starting… [PM2] Process config loading failed [] ┌──────────┬────┬──────┬─────┬────────┬─────────┬────────┬─────┬─────┬──────────┐ │ App name │ id │ mode │ pid │ status […]

在哪里把testing文件的webdriverIOtesting – 使用docker集装箱?

我不明白如何运行我的nodeJS应用程序的webdriverIO e2etesting。 正如你所看到的,我的nodeJS应用程序也作为docker容器运行。 但是现在我得到了一些非常基本的东西: 那么我要把我想要运行的testing文件放在哪里? 我必须将它们复制到webdriverio容器中吗? 如果是,在哪个文件夹? 那么我该如何运行testing呢? 这是我的docker组成所有需要的docker集装箱的设置: services: webdriverio: image: huli/webdriverio:latest depends_on: – chrome – hub environment: – HUB_PORT_4444_TCP_ADDR=hub – HUB_PORT_4444_TCP_PORT=4444 hub: image: selenium/hub ports: – 4444:4444 chrome: image: selenium/node-chrome ports: – 5900 environment: – HUB_PORT_4444_TCP_ADDR=hub – HUB_PORT_4444_TCP_PORT=4444 depends_on: – hub myApp: container_name: myApp image: 'registry.example.com/project/app:latest' restart: always links: – 'mongodb' environment: – […]

运行在Docker容器中的Node.js进程在内存不足时不会退出或抛出

我最近偶然发现了一个有趣的问题:我有一个Express Node.js应用程序,我正在使用Docker镜像将其部署到AWS ECS。 但是,它正确部署,运行状况检查失败,检查日志后,我发现该过程在Express初始化过程中无限期挂起而不会出现任何错误。 起初我以为这是由于某些networkingmiss-configuration导致的,它阻止了HTTP端口启动一个监听器的过程,但经过非常繁琐的检查之后,我注意到,默认的内存限制已经到位, 50 MB的内存,当进程实际上需要多一点。 增加内存限制后,它开始正常工作。 为什么它挂在没有任何错误。 当发生这种情况时,Node进程是否应该退出并报错? 今后如何防止这样的问题呢? 也就是说,当这种情况发生时,我希望我的stream程被有意义的错误终止。 谢谢!

如何使用docker-compose运行Express和Mongo

如何使用docker-compose运行Express和MongoDB? 我的docker-compose.yml如下所示: version: '3' services: express: image: node:7.7.2-alpine container_name: express-container ports: – 3000:3000 volumes: – .:/application/ – /application/node_modules links: – mongodb command: npm start mongodb: image: mongo:3.4.4 container_name: mongo-container ports: – 27017:27017 运行后docker-compose up mongo看起来工作正常: mongo-container | 2017-07-06T22:17:53.939+0000 I NETWORK [thread1] waiting for connections on port 27017 但是明示给我这个: express-container | npm info it worked if […]