草庐IT

event_start

全部标签

node.js - npm "scripts": "start" run express and open url

我在package.json中有这个启动参数"scripts":{"start":"nodebin/www"},当我输入npmstart时,它正在运行我的express应用程序。但我希望浏览器同时打开http://localhost:8081。我怎么能对start说也打开我的本地url?like:"start":"nodebin/www,http://localhost:8081"所以当我输入npmsatrt时,它会运行我的快速应用程序并同时打开网址。 最佳答案 据我所知,这就像写一个bash命令://Windows"start":

node.js - 尝试构建 Cordova 应用程序时获取 'spawn cmd ENOENT' (event.js :85)

当我尝试构建(模拟)Cordova应用程序时,在windowscmd中出现此错误。D:\dev\Cordova\toDoList>cordovabuildandroidRunningcommand:D:\dev\Cordova\toDoList\platforms\android\cordova\build.batevents.js:85thrower;//Unhandled'error'event^Error:spawncmdENOENTatexports._errnoException(util.js:746:11)atProcess.ChildProcess._handle.on

javascript - event.path 未定义在 Firefox 中运行

当我在Firefox中运行event.path[n].id时,我收到此错误。它适用于其他浏览器。event.pathundefined 最佳答案 Event对象的path属性是非标准的。标准等效值为composedPath,这是一种方法。但它是新的。所以你可能想尝试回退到那个,例如:varpath=event.path||(event.composedPath&&event.composedPath());if(path){//Yougotsomepathinformation}else{//Thisbrowserdoesn'tsu

javascript - 事件.js : 141 throw er;//Unhandled 'error' event

我正在尝试在MacOS上运行Node4.2.2,但我不明白为什么每次收到此错误消息:events.js:141thrower;//Unhandled'error'event^Error:spawn/Users/user/Documents/Projects/project-x/node_modules/gifsicle/vendor/gifsicleENOENTatexports._errnoException(util.js:874:11)atProcess.ChildProcess._handle.onexit(internal/child_process.js:178:32)at

Node.js + Express : app won't start listening on port 80

我创建并启动这样的应用程序:express-s-tejsnpminstallexpressnpminstallejsnodeapp.js它可以工作(在端口3000上)。但是当我将端口更改为80时,运行nodeapp.js会输出:node.js:198throwe;//process.nextTickerror,or'error'eventonfirsttick^TypeError:Cannotcallmethod'getsockname'ofnullatHTTPServer.address(net.js:746:23)atObject.(/var/www/thorous/app.js:

javascript - npm start 与 Node app.js

我对Node非常陌生,并试图了解应用程序的基础知识。我很好奇为什么这两个命令:nodeapp.js--vs--npmstart向控制台输出同样的东西,似乎继续“收听”,但是为什么当我尝试访问http://localhost:3000时我只在运行第一个命令时得到404。我看到Express4似乎具有不同的应用程序结构,但为什么一个成功监听而另一个没有,尽管控制台中的行为相同?任何解释都是有帮助的。谢谢! 最佳答案 这两个命令不一定相同。npmstart运行任何'start'脚本配置所说的运行,如你的'package.json'中定义的

Node.js https pem 错误 : routines:PEM_read_bio:no start line

我现在正在使用node.js处理登录表单,我尝试使用创建pemkey和csropensslreq-newkeyrsa:2048-new-nodes-keyoutkey.pem-outcsr.pem但是我在运行nodeserver.js时遇到错误这是我的server.jsvarhttp=require('http'),express=require('express'),UserServer=require('./lib/user-server');varhttps=require('https');varfs=require('fs');varoptions={key:fs.readF

linux - Mongo 守护进程不由 service mongod start 运行

最近我通过阅读此页面(http://docs.mongodb.org/manual/tutorial/install-mongodb-on-ubuntu/)安装了mongodb包。我使用docker和ubuntu14.04镜像来部署我的服务器。问题首先从运行mongod服务开始:#servicemongodstart我得到了以下信息:Ratherthaninvokinginitscriptsthrough/etc/init.d,usetheservice(8)utility,e.g.servicemongodrestartSincethescriptyouareattemptingto

linux - Mongo 守护进程不由 service mongod start 运行

最近我通过阅读此页面(http://docs.mongodb.org/manual/tutorial/install-mongodb-on-ubuntu/)安装了mongodb包。我使用docker和ubuntu14.04镜像来部署我的服务器。问题首先从运行mongod服务开始:#servicemongodstart我得到了以下信息:Ratherthaninvokinginitscriptsthrough/etc/init.d,usetheservice(8)utility,e.g.servicemongodrestartSincethescriptyouareattemptingto

node.js - npm start 如何在 8000 端口上运行服务器

我最近使用来自github的angular-seed文件夹进行Angular应用程序开发。在之前的一些angularjs教程中,angular-seed文件夹中有一个脚本文件夹和一个server.js文件,其中包含运行Node服务器的所有配置。那么npm现在是如何开始运行Node服务器的,该Node服务器的所有配置在哪里? 最佳答案 我们有一个react应用程序,我们的开发机器是mac和pc。启动命令不适用于PC,所以我们是这样解决的:"start":"PORT=3001react-scriptsstart","start-pc":