Tag: ubuntu 16.04

无法在Ubuntu 16.04上安装节点

我从Windows移到Ubuntu,按照网站的说明 – https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions 下面的命令顺利运行 curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash – 然后 sudo apt-get install -y nodejs 上述命令的输出是: $sudo apt-get install -y nodejs Reading package lists… Done Building dependency tree Reading state information… Done nodejs is already the newest version (4.2.6~dfsg-1ubuntu4.1). 0 upgraded, 0 newly installed, 0 to remove and 519 not upgraded. 正如你可以看到它的版本4的nodejs,虽然我试图安装8 […]

无法访问google云ubuntu 16.04实例上的nodeJS REST API,但是我可以成功ping公共IP

我在谷歌云上有一个Ubuntu 16.04实例,我可以用它的公共IP来ping实例,我试图在它上面运行一个nodeJS后端REST-API ..我已经成功地在本地机器上检查了API和mongoDB。 在terminal连接,我可以看到nodeJS我的服务器(API)正在运行,但我无法访问它。 我已经尝试使用networking浏览器和邮递员的API调用,但延迟几秒钟后出现以下错误“无法得到任何响应 – 有一个错误连接到:”如何解决这个问题,什么可能是这个问题的原因。

在机器启动时启动节点服务器

我试图通过在nodeserv.conf文件中使用以下代码,在启动机器(ubuntu 16.04)上启动node.js服务器: #!upstart description "Node.js server" author "Sushant Kumar" start on started mountall stop on shutdown respawn respawn limit 99 5 script export APP_HOME = "/home/ubuntu/chatbot_server" export HOME = "/home/ubuntu" cd $APP_HOME exec sudo -u ubuntu /usr/local/nodejs/bin/node $HOME/chatbot_server/server.js >> /var/log/chatbotserv.log 2>&1 end script post-start script echo "Node Started" end script ,但我运行命令 # start nodeserv 我得到followig错误: […]

如何解决错误:在运行Karma时产生Jenkins上的EACCES?

我已经设置了AWS Codepipeline。 该pipe道使用Git作为源,Jenkins进行testing,并使用EC2实例进行部署。 该项目是基于Angular Class的Angular Starter 。 因此,它使用Karma进行unit testing。 Jenkins服务在Ubuntu 16.04上运行。 Karma使用Headless Chrome进行testing。 问题是我目前在Jenkins上运行testing时遇到以下错误: [31m07 05 2017 14:30:35.779:ERROR [karma]: [39m{ Error: spawn EACCES at exports._errnoException (util.js:1050:11) at ChildProcess.spawn (internal/child_process.js:319:11) at exports.spawn (child_process.js:378:9) at spawnWithoutOutput (/var/lib/jenkins/workspace/ExampleTask/node_modules/karma/lib/launchers/process.js:168:24) at Object.ProcessLauncher._execCommand (/var/lib/jenkins/workspace/ExampleTask/node_modules/karma/lib/launchers/process.js:76:21) at Object.ProcessLauncher._start (/var/lib/jenkins/workspace/ExampleTask/node_modules/karma/lib/launchers/process.js:33:10) at Object.<anonymous> (/var/lib/jenkins/workspace/ExampleTask/node_modules/karma/lib/launchers/process.js:19:10) at emitOne (events.js:101:20) at Object.emit (events.js:191:7) at Object.BaseLauncher.start (/var/lib/jenkins/workspace/ExampleTask/node_modules/karma/lib/launchers/base.js:42:10) at Object.j […]

为什么我只能在Debian / Ubuntu上安装过时的NPM版本?

我正在使用基于Debian / Ubuntu的发行版(特别是AWS Ubuntu 16.04),并试图通过apt-get来安装NPM。 我的Angular 2应用程序需要的版本高于NPM的3.9.x版本,但是在AWS Ubuntu 16.04上使用sudo apt-get install npm安装的默认版本是3.5.2。 我试图更新NPM,但是它没有从3.5.2升级到4.6.1(最新)。 如何安装/更新NPM,以便获得最新版本?

Nodemon内部监视失败的错误?

我不知道发生了什么,但突然间我的Nodemon开始显示错误。 nikhil@nikhil-Lenovo-Z50-70:~/Desktop/dominos$ nodemon server.js [nodemon] 1.12.1 [nodemon] to restart at any time, enter `rs` [nodemon] watching: *.* [nodemon] starting `node server.js` [nodemon] Internal watch failed: watch /home/nikhil/Desktop/dominos ENOSPC 即使在那之后我的程序运行良好。 但是当我closures这个project1并在同一个端口上运行另一个project2时,就会发生这个错误 Error: listen EADDRINUSE :::3000 at Object.exports._errnoException (util.js:1024:11) at exports._exceptionWithHostPort (util.js:1047:20) at Server.setupListenHandle [as _listen2] (net.js:1319:14) at listenInCluster (net.js:1367:12) at Server.listen (net.js:1467:7) at Object.<anonymous> (/home/nikhil/Desktop/dominos/server.js:533:8) at […]

PM2环境variablescaching

我在Ubuntu 16.04上运行PM2,似乎环境variables正在被caching。 有没有办法看到哪些环境variablesPM2正在使用。 它可以以某种方式看到的环境variables不再在我的terminal会话中可用echo $VAR_NAME 。 我创build了这样的环境variables: export VAR_NAME=value 使用以下命令删除环境variables: unset VAR_NAME 不工作PM2固执地坚持环境variables – 即使在各种重启和ssh会话之后。 渲染我困惑: – / 有没有办法刷新PM2正在使用的环境variables? 或者至less看看它知道哪些环境variables?

将angularjs应用程序从Windows移动到Ubuntu

我使用nodejs,http-server,gulp和brackets在窗口上开发了一个angular度应用程序。 在Windows中我有一个根目录(lms)包含: /src /src/templates /src/js /src/img /src/index.html /node_modules package.json 在Ubuntu中,我有一个名为/ home / lms的目录。 我已经安装了nodejs,angularjs和http服务器,但不是吞咽或凉亭,因为我不会在Ubuntu中进行开发。 我在家看到/ lms: /Public /Templates /Pictures /node_modules 我如何部署我的文件? 我假设我把我的package.json放在home / lms中,但是我不能将Windows node_modules复制到Ubuntu node_modules,所以如何为Ubuntu创buildnode_modules? 另外,我把我的应用程序目录/ src放到Ubuntu的/ home / lms / Public目录下,或者只是把它添加到/ home / lms?

如何在Ubuntu 16.04上安装NodeJS 6.1.0

我已经使用sudo apt-get install nodejs命令sudo apt-get install nodejs 这是安装节点版本6.5.0。 但是我必须在版本6.1.0上工作。 我怎样才能安装一个特定的版本?

TypeError:无法读取未定义的属性'_locals'

我试图在Ubuntu 16.04中使用nodejs,我安装了节点和NPM,但我有这个错误“TypeError:无法读取未定义的属性'_locals'当我试试这个: var express = require("express"); app = express(); bodyParser = require("body-parser"); mongoose = require("mongoose"); app.set("view engine", "ejs"); app.get("/", function(req,res){ app.render("index"); }); app.listen(3000, function(){ console.log("Server Started!"); }) 它在terminal输出: Server Started! TypeError: Cannot read property '_locals' of undefined at EventEmitter.render (/home/luis/Documents/work/webdevBootcamp/test/node_modules/express/lib/application.js:548:11) at /home/luis/Documents/work/webdevBootcamp/test/app.js:9:6 at Layer.handle [as handle_request] (/home/luis/Documents/work/webdevBootcamp/test/node_modules/express/lib/router/layer.js:95:5) at next (/home/luis/Documents/work/webdevBootcamp/test/node_modules/express/lib/router/route.js:131:13) at Route.dispatch (/home/luis/Documents/work/webdevBootcamp/test/node_modules/express/lib/router/route.js:112:3) at Layer.handle […]