Tag: webstorm

'require'关键字不被webstorm识别

我正在使用WebStorm作为IDE。 这里是我的文件夹结构和express.js insisted: 但是我的示例代码不知道require关键字: var express = require('express'); var app = express(); app.listen(1337, function(){ console.log("ready"); }); 更新 Per Darin的答案这是我的package.json文件,现在位于网站文件夹的根目录中: { "name": "MyTestSite.com", "version": "0.0.1", "description": "A Website", "main": "test.js", "directories": { "test": "tests" }, "dependencies": { "express": "^4.11.2" }, "devDependencies": {}, "scripts": { "test": "n/a" }, "repository": { "type": "git", "url": "https://github.com/n/a" }, "keywords": [ […]

脚本在Webstorm中失败,但不是从terminal

我有一个nodejs脚本,它使用phantomjs-node来抓取一个网页。 当我从terminal窗口运行时,它工作正常,但是当我通过Node JS应用程序的运行configuration从Webstorm内部运行时,它工作正常。 什么可能导致Webstorm中的错误? 我已经尝试在注释掉.bash_profile的内容之后从terminal运行脚本,它仍然有效。 我也在另一个示例脚本中检查了process.env的内容,发现Webstorm和terminal的值完全不同。 剧本: var phantom = require('phantom'); phantom.create(function(ph) { return ph.createPage(function(page) { return page.open("http://www.google.com", function(status) { console.log("opened google? ", status); return page.evaluate((function() { return document.title; }), function(result) { console.log('Page title is ' + result); return ph.exit(); }); }); }); }); terminal输出(伟大的工程!): opened google? success Page title is Google Webstorm控制台输出(失败): /usr/local/bin/node phantom.js […]

从package.json“脚本”部分创buildWebStorm运行configuration

在我的package.json文件中,我有以下“脚本”configuration。 … "scripts": { "start": "watchify -o lib/index.js -v -d .", "build": "browserify . | uglifyjs -cm > lib/index.js", "test": "jest" } … 这允许我从命令行运行npm start , npm build和npm test 。 这很棒! 但理想情况下,由于界面非常方便,我希望能够使用运行configuration从WebStorm内运行这些任务。 我一直无法弄清楚如何做到这一点。 有没有办法创build我自己的自定义运行configuration或从我的package.json自动生成它们?

良好的IDE为node.js + coffeescript +茉莉

用Jasmine,node.js和coffeescript组合开发什么好的IDE。 到目前为止,我们正在考虑WebStorm,但开始真的很难。 我们发现node.js(和coffeescript)与IDE结合的文档非常less。 还有什么其他的select? (有没有可以帮助我们开始/运行的指南?) 编辑: 我和我的团队正在运行Windows / OSX。 Vim / Emacs 不是一个选项。 我们需要一些graphics界面/ IDE。 在IDE中使用node.js和coffee必须很容易。 最好有点“适合”用于node.js。 WebStorm承诺做到这一点,然而,开始起步相当困难。 运行.coffee似乎不工作。 谢谢 :)

需要解决方法使WebStorm的自动完成能够解决第三方模块方法

几乎所有的第三方模块WebStorm的autocomplition不能解决方法/领域。 在autocompletion下,我的意思是所有的intellisense-likefunction。 例如: var async = require('async'); async.series() //WebStorm's tooltip says: Unresolved function or method series() 同时解决 async.exports.series(). 但是这会导致运行时错误: TypeError: Cannot call method 'series' of undefined 对于我自己的模块,我find了解决方法。 如果我在模块中做: var myModule = module.exports; myModule.someMethod = function(){ … } 然后someMethod autocomplition工作正常。 关于以上所有问题,我有一堆问题。 1.为什么ide无法parsingasync.series()? 2.为什么async.exports.series()导致运行时错误? 3.如何使autocomplition工作? WebStorm 5.0.4。

Webstormdebugging器断点在nodejs中不起作用

当我尝试设置断点并debugging文件时,debugging器只运行应用程序而不停在断点处。 这是我的代码: console.log('123'); 这是我的输出: /usr/bin/node –debug-brk=39765 –nolazy index.js debugger listening on port 39765 123 Process finished with exit code 0 有没有人有一个想法可能是什么问题?

在WebStorm中debugging编译ES6 nodejs应用程序

我想debugging一个从babel编译的ES6文件运行的节点应用程序。 我有一个src文件夹中的ES6源代码和buildel文件夹中的babel ES5等价物。 Project root | | build | > ES5 Compiled files | | src | > ES6 Source files 我的目标:直接在我的ES6源代码中放置断点。 我已经生成了适当的源映射,并且我创build了一个节点debuggingconfiguration,该configuration运行ES5主文件,并将项目根设置为工作目录。 当我在ES5编译文件中设置断点时,可以中断,并自动显示我的ES6源代码。 不过,我想直接在ES6源代码中放置断点 。 这甚至可能吗? – > 2015-10-11编辑< 当我使用绝对的sourceRoot时,源映射现在可以在@ mockaroodev的configuration下 sourceRoot ! 然而 ,debugging仍然是打破:有时候会把我带到意想不到的地方。 似乎当该行暗含非内部(非本地) require时,debugging器将在所需内容结束时中断。 这是非常烦人的! 我在Linux上使用Webstorm 10.0.4,并将babel和sourcemaps升级到最新版本。 有人也遇到这个问题吗?

如何使用WebStorm IDEdebugging我的Meteor应用程序?

任何人都可以提供如何将一个meteor应用程序连接到WebStormdebugging器的简短步骤清单吗?

Karma.js安装在WebStorm – bash:karma:命令未find

所以我从nodejs.org安装了node.js,并在我的项目中使用Webstorm命令工具安装了karma.js:npm install karma。 在Webstorm-> Settings-> Path Variables中,我还添加了3个pathvariables(请告诉我哪个不需要)。 名称 :nodejs 值 :/ usr / local / bin 名称 :npm 值 :/ usr / local / lib / node_modules / npm / bin 名称 :karma 值 :/ Users / maxime / Documents / WebStorm / icms / node_modules / karma / bin 当我inputinit karma来获得karmaconfiguration文件时,我得到: bash:karma:command not found […]

将WebStorm连接到远程的node.jsdebugging会话

我在Oracle VirtualBox的Linux VM中运行Node.js应用程序。 VM上的端口5858被转发到本地主机上的端口5858 。 我在主机操作系统(Windows 7)上运行WebStorm。 在WebStorm中,单击Run >> Edit Configurations….然后单击添加button(加号)并selectNode.js remote debug 。 然后inputconfiguration的名称,并将主机保留为127.0.0.1 ,端口号为5858 。 我点击OK ,并确保我的节点应用程序正在运行在虚拟机与–debug标志。 然后点击WebStorm工具栏中的错误图标,debugging器出现在WebStorm IDE的底部。 如何确认连接成功? 断点不起作用,WebStorm中的控制台保持为空(当信息发送到Linux VM上的控制台时)。 任何人都可以build议还需要做什么,以获得远程debugging会话工作?