怎么办?我长得长太帅被交警带走了我怕被打死,昨天就被一群人打了一顿,我怕怎么办?😭。

下次自动登录
现在的位置:
& 综合 & 正文
WebStorm+Node.Js基础配置。
没有前文,只有正文。步骤如下:
1、安装WebStorm;参考地址:
2、安装Node.Js;参考地址:
3、点击下图所示图标
接下来:(这个是配置好的。如果没配置好,狠先下载。直接点就是了)
此时环境就配置好了。接着来写点基本的。
* Created with JetBrains WebStorm.
* User: Hstar
* Date: 12-11-18
* Time: 下午10:46
* To change this template use File | Settings | File Templates.
var http=require('http');
http.createServer(function(req,res){
res.writeHead(200,{'Content-Type':'text/plain'});
res.end('Hello World\nThis is my first NodeJs');
}).listen(.0.1');
console.log("Server running at http:127.0.0.1:2222");
此时,右键如下图所示:
点击运行。此时我们可以打开浏览器,测试刚启动的这段代码。
图示如下:
到此,一个简单的NodeJs开发环境已经搞定。结束了。初学Node,还望多多交流。
&&&&推荐文章:
【上篇】【下篇】相信大家接触过不少node代码了,如果你应用的比较初级或者针对你的项目不需要接触过深的node代码,也许你仅仅需要简单的console.log('your variable')就完全满足你的需要了。如果你应用node比较深入,想要调试(debug)之,我想你应该接触过,大致用法流程,简单如下&&
1.安装:npm install -g node-inspector
2.启动debug模式(单独命令行):
node-debug &(该命令默认8080端口)
node-debug --web-port 1984 (定义任意端口)
3.访问chrome debug devTools
  路径如:http://127.0.0.1:1984/?ws=127.0.0.1:1984&port=5858
4.启动gulp或者grunt服务(具有gulp或者grunt任务时)
  node --debug-brk $(which grunt) server (这种模式使用在第一次初始化执行的代码)
  node --debug $(which grunt) server(这种模式使用在初始化之后监听的node代码)
调试面板与chrome developer tools基本一致,很熟悉,知道怎么使用chrome的,都知道怎么玩儿好它,没什么学习成本。
在这里,主要介绍一下使用webstorm去调试node代码,之前在网上各种搜索了一番,不是很靠谱,所以,自己多做了些尝试与思考,在这儿汇总总结,希望可以帮助到使用webstorm的同学。
如果你不知道webstorm,好吧,看看吧。对于编辑器的选择,每个人都有不同观点,在此不讨论。只是个人用过eclipse(aptana)、sublime text、webstorm,一步步小小进阶,便对webstorm爱不释手了,功能非常强大,集成度确实比较高。基本的用法有机会再详细讨论,这里只介绍如果调试node程序。
如果你玩儿过java,使用eclipse调试起来,确实方便。或者你玩儿php,相信phpstorm调试php代码也非常不错。如果有个IDE同样能够调试Node,那就太赞了。没错,一个webstorm搞定这些。
主要按照如下目录介绍&&
1.调试nodejs程序&&常规用法(run/debug模式)、调试面板等介绍
2.调试gulp/grunt
3.调试web应用
1.调试nodejs程序
可以看到在23行打了一个断点。想要断点起作用,那么需要对该文件做debug配置&&
Run模式,直接运行该文件,不会对断点起作用,此时,可以通过打日志(console.log)的方式进行调试,它会顺序执行该js文件,并不需要有入口方法或者入口类等等(不同于java)。
接下来可进行配置&&
点击&Debug&之后,会看到&&
就可以看到,代码debug于23行了。同时在下方的Debug面板中,能够看到Debug toolbar和Stepping toolbar,至于两个toolbar的说明,看看官方IntelliJ IDEA的说明即可,附上链接地址:
启动debug,更便捷的方式,就是该文件右键后,选在debug即可。看下图&&
以上,可以调试简单的node程序代码,操作很简单,也很方便。接下来,看看如何调试gulp任务(grunt类似,就不列举了)。
2. 调试gulp
在对应的gulpfile.js文件上面,右键即可,如下图&&
选择&Create 'clean'&用来添加配置并启动debug;若选择&Debug 'clean'&可以直接进行调试。
如果你的任务并没有在gulpfile.js文件中声明,同样可以打开配置对话框进行配置,如下:
注意在gulpfile.js内部进行操作,它需要加载所有的任务名称,这样调试才会有效。会看到调试页面如下&&
如上图,我们看见了程序走到50行断点处,承接以上,继续说一下如何调试web应用。
3.调试web应用
如上图,我们已完成gulp任务的断点调试的配置(针对非gulp任务的普通node程序,同样如是),当web进行访问时,自然会再对应断点处停下,如&&
也可以看到对应浏览器一直处于加载状态,如下图&&
如果想要对request对象中传递的参数进行查看的话,如&&
OK,调试web应用介绍到这儿。
从各个应用分类(node普通程序调试、gulp/grunt任务调试、web调试等)的角度,对应的调试的配置及方法介绍到这儿。比较简单、便捷。
希望读到这篇文章的你,可以试试webstorm,或许你也会爱上它。
阅读(...) 评论()私活儿神器
MASHUPCLOUD 聚云网
最具价值web全栈课程
只做前端开发培训的好学校,专注于多方向全栈工程师培养。前端名师邵山欢亲自授课,课程涵盖HTML5、CSS3、Node.js、Angular、React诸多课程,免费视频广受学生好评。
跟牛人学前端
跟牛人学前端
妙味大前端自学宝典
妙味课堂2016年JavaScript课程大纲震撼升级、全栈来袭!
前端最新干货
前端最新干货
Nodejs在线课程
智能社就是全栈开发培训,国内正规的JavaScript、HTML5、NodeJS培训机构,专注于让学员获得快乐的学习体验并找到高薪工作的培训
学前端,这套就够了!
传智播客博学谷前端与移动开发学院 - WEB前端培训,HTML5培训,移动开发培训
您的位置: » 分类:
» 文章: 在Webstorm中使用Autoprefixer
您可能感兴趣的文章
近期最热文章
- 2,931 - 2,207 - 2,207 - 2,110How can I run nodemon from within WebStorm? [我如何从内部运行nodemon WebStorm ?] - 问题-字节技术
How can I run nodemon from within WebStorm?
我如何从内部运行nodemon WebStorm ?
问题 (Question)
I would like to use
from within the WebStorm IDE (version 7). Nodemon watches one or more files in my source folder and restarts the node process (an Express server in this case), when one of the source files changes.
How do I configure WebStorm to use nodemon in a Run Configuration, so that the node process is automatically restarted?
Without nodemon, I use the following configuration in WebStorm, but have to restart the node process whenever I change something in the source file:
Node interpreter: /usr/local/bin/node
Working directory: /Users/foo/test
JavaScript file: server.js
This results in a Run Configuration that runs node server.js in the specified directory.
From command line, I can use the following command to use nodemon to watch for file changes: nodemon server.js in the project directory.
How do I need to change the WebStorm configuration so that it also uses nodemon?
我想使用从内部WebStorm IDE(第7版)。Nodemon手表在我的源文件夹和一个或多个文件重启节点过程(Express服务器在本例中),当一个源文件的更改。我怎么WebStorm配置为使用nodemon在运行配置中,这样的节点过程是自动重新启动吗?没有nodemon,我在WebStorm使用以下配置,但每当我有重新启动节点过程改变的东西在源文件:节点的翻译:/usr/local/bin/node工作目录:/Users/foo/testJavaScript文件:server.js这导致一个运行的运行配置node server.js在指定的目录中。从命令行,可以使用以下命令使用nodemon注意文件的变化:nodemon server.js在项目目录中。我需要怎么更改WebStorm配置,它还使用nodemon吗?
最佳答案 (Best Answer)
It looks like the workaround with --exec isn't necessary anymore, at least when using the newest version of
and Webstorm 7 or 8.
All you have to do is specify your path to nodemon (e.g. /usr/local/bin/nodemon) under "Node parameters":
@Bela Clark, thanks for confirming.
它看起来像的解决方案--exec没有必要了,至少在使用最新版本的和Webstorm 7或8。所有你要做的就是指定路径nodemon(如。/usr/local/bin/nodemon)“节点参数”:@Bela克拉克,谢谢你的确认。
答案 (Answer) 2
To install nodemon, use the following (if required, use sudo to run the installation with root privileges:
npm install -g nodemon
This will install nodemon globally on your machine.
Then, in your WebStorm Run Configuration, add the following, leaving everything else unchanged:
Node parameters: /usr/local/bin/nodemon --exec /usr/local/bin/node
This will instruct the node interpreter to execute the nodemon script using the following command line: node /usr/local/bin/nodemon --exec /usr/local/bin/node server.js.
The --exec part is important, as the execution will fail with the following error:
/usr/local/bin/node /usr/local/bin/nodemon server.js
4 Oct 13:56:50 - [nodemon] v0.7.10
4 Oct 13:56:50 - [nodemon] to restart at any time, enter `rs`
4 Oct 13:56:50 - [nodemon] watching: /Users/foo/test
execvp(): No such file or directory
4 Oct 13:56:50 - [nodemon] starting `node server.js`
4 Oct 13:56:50 - [nodemon] exception in nodemon killing node
Error: spawn ENOENT
at errnoException (child_process.js:980:11)
at Process.ChildProcess._handle.onexit (child_process.js:771:34)
The error seems to be caused by WebStorm not seeing the node executable on its path.
The fix for this is to specify the location to the node executable using the --exec /usr/local/bin/node parameter.
Using these settings, nodemon works fine when run from a WebStorm Run Configuration.
The same trick might have to be used with some of the tools similar to nodemon, e.g. .
安装nodemon,使用以下(如果需要,使用sudo运行安装使用root特权:npm install -g nodemon
答案 (Answer) 3
I'm on Windows and for me didn't worked with nodemon (no idea way), but someone from jetbrains suggested to try with supervisor:
I installed supervisor : npm install supervisor -g
Then find where is installed supervisor, for me was in:
C:\Users\AlinC\AppData\Roaming\npm\node_modules\supervisor\lib\cli-wrapper.js –no-restart-on error
I went back to intellij and to edit configurations -> node parameters -> and added:
C:\Users\AlinC\AppData\Roaming\npm\node_modules\supervisor\lib\cli-wrapper.js –no-restart-on error
我在窗户和我并没有使用过nodemon(不知道),但有人从jetbrains建议尝试主管:我安装主管:npm install supervisor -g然后找到安装在哪里supervisor,对我来说:C:\Users\AlinC\AppData\Roaming\npm\node_modules\supervisor\lib\cli-wrapper.js –no-restart-on error我回到intellij和编辑配置- &节点参数- &和补充道:C:\Users\AlinC\AppData\Roaming\npm\ node_modules主管\ \ lib \ cli-wrapper。js -no-restart-on错误
答案 (Answer) 4
You can just use the nodemon.cmd instead of node directly like :
Node interpreter : C:\MyPath\To\nodemon.cmd
Node parameters : /*Empty for me*/
Node WorkingDirectoy : C:\Users\MyUserName\Desktop\DirectoryContainingMyIndex.js
JavaScriptFile : app\index.js /*or just index.js depending on your config*/
and then :
Hope it will help you.
你可以使用nodemon。cmd,而不是直接节点:Node interpreter : C:\MyPath\To\nodemon.cmd
Node parameters : /*Empty for me*/
Node WorkingDirectoy : C:\Users\MyUserName\Desktop\DirectoryContainingMyIndex.js
JavaScriptFile : app\index.js /*or just index.js depending on your config*/
答案 (Answer) 5
Do a npm install nodmemon -g
Only change the Path to Node to the nodemon.cmd, in my case (C:\Users\Rohit Taneja\AppData\Roaming\npm\nodemon.cmd), you'll also get this path after your installion of nodemon finishes.
You're good to go
做一个npm安装nodmemon - g只修改nodemon路径节点。cmd,在我的例子中(C:\ Rohit希夫\ AppData \漫游用户\ \ npm \ nodemon.cmd),你也会得到这个路径nodemon安装完成后。你是好去
答案 (Answer) 6
@bernhardw
On my Webstorm 8.0.1:
Note interpreter: /usr/local/bin/nodemon
Node parameters : --exec /usr/local/bin/node
@bernhardw在我Webstorm 8.0.1:注意解释器:/usr/local/bin/nodemon节点参数:- exec /usr/local/bin/node
本文翻译自StackoverFlow,英语好的童鞋可直接参考原文:

我要回帖

更多关于 长得太帅怎么办 的文章

 

随机推荐