Tag: webstorm

ReferenceError:需求未定义(Webstorm)

试图做一些令人难以置信的基本的东西,但遇到一个障碍。 var mongoose = require('mongoose'); mongoose.connect('mongodb://localhost/jetbrains'); var Product = mongoose.model('Product', {name: String}); var product = new Product({name: "WebStorm"}); product.save(function(err) { if(err){ console.log('failed'); }else{ console.log('saved'); } }); 不断得到ReferenceError:require在[文件path]中没有定义。 我正在Webstorm 10中这样做。尝试从Webstorm中的MEAN开发中学习本教程。 https://www.youtube.com/watch?v=JnMvok0Yks8 想法?

咕噜生成和服务相对path不匹配

我有一个典型的目录结构设置我的angular应用程序。 我在应用程序目录中也有一个git子模块: app submod submod.js submod.css bower_components dist node_modules bower.json Gruntfile.js package.json … 我的index.html是为grunt build任务设置的。 一切工作正常,除了子模块文件,因为path导致问题。 如果我把“应用程序”放在path中,构build会正常工作: <!– build:css(.) styles/vendor.css –> <!– bower:css –> <link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap.css" /> <!– … –> <!– endbower –> <link rel="stylesheet" href="app/submod/submod.css" /> <!– endbuild –> 但是,使用grunt serve在本地运行应用程序将不起作用,除非我从path中删除应用程序: <!– build:css(.) styles/vendor.css –> <!– bower:css –> <link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap.css" /> <!– […]

Webstorm 10 mongoose未解决的function与mongoose-DefinitelyTyped安装

我最近重新安装了我的MEAN堆栈开发环境。 我不能在Webstorm 10中为我的生活取得mongoosefunction。我已经安装并检查了mongoose-DifflyTyped和mongodb-DefinitelyTyped。 我的node.js应用程序运行良好,可用。 我正在用mongoose来做我的模特。 我以前的发展环境在理论上是一样的,没有“不能解决的问题”。 我想知道是否有人有任何build议。 谢谢!

TS2304:无法在节点5.1.0,typescript 1.6.2,webstorm 11中find名称“Map”

当在webstorm 11中使用filewatchers时,我得到了ts-compiler 1.62的TS2304错误。 TS2304:找不到名称“地图” 停用filewatcher并使用该命令 tsc –target es6 app.ts 在目录中运行良好,但我想有自动化。 我试过了: tsd install node 没有任何影响。 我能做什么?

Webstorm导入Angular 2的url问题

寻找一些关于WebStorm v11的指导和使用Angular2导入,我也在Mac上。 每当我创build一个组件,并从Angular 2导入例如Http服务,WebStorm就会自动将它导入到页面上。 然而,导入的URL是一个疯狂的string,但在所有的演示,我已经看到它只是导入到这样一个简单的string: import {Http} from "angular2/core"; 但是我会像这样导入: import {Http} from "../../../node_modules/angular2/src/http/http"; 所以我会手动去改变它更简单的可读性,它仍然工作正常。 任何想法或帮助我怎样才能得到它与简单的string导入?

为什么在更改npm默认目录后WebStorm不能列出我安装的软件包?

这是执行命令npm config ls -l : C:\Users\Administrator>npm config ls -l ; cli configs long = true user-agent = "npm/2.15.1 node/v4.4.4 win32 x64" ; builtin config undefined cache = "D:\\npm-cache" prefix = "D:\\npm" ; default values access = null always-auth = false bin-links = true browser = null ca = null ; cache = "C:\\Users\\Administrator\\AppData\\Roaming\\npm-cache" (overridden) cache-lock-retries […]

如何在WebStorm中设置代理时使用npm?

我试图在WebStorm IDE中使用节点包pipe理器来安装包,但是我得到了一个407代理validation所需的错误。 我试图在npm设置下设置HTTP_PROXY和HTTPS_PROXY环境variables,但似乎没有任何工作。 有没有其他人有类似的问题,如果是这样,你怎么解决他们?

从WebStorm运行NodeJs脚本会出现“spawn cmd.exe ENOENT”错误

在WebStorm上以Build Configuration执行nodejs脚本失败,并出现以下错误: Warning: spawn cmd.exe ENOENT Use –force to continue. Aborted due to warnings. 从terminal运行相同的脚本工作正常。 失败的部分正在运行grunt任务(shell命令): function buildInserter(cb) { var defer = Q.defer(); grunt.tasks([ 'shell:release-inserter' ], { gruntfile: './gruntfile.js' }, function () { defer.resolve(); if( typeof cb === 'function' ) { cb(); } }); return defer.promise; } 我尝试了这个答案中描述的方法,但没有帮助。

从WebStorm express项目部署独立的node.js服务器

总菜鸟问题,但在我的时间search没有find一个合适的解决scheme: 我已经使用WebStorm IDE制作了一个Node.js / express服务器, WebStorm进行了testing并成功运行,但是现在完成了,我希望能够以独立项目的方式手动运行它。 我试图运行www js文件,它启动服务器,但是一些function丢失,如无法find并运行python脚本(找不到)。 我的问题是如何完全转移WebStorm项目中包含的所有function,以便服务器可以在IDE之外运行? ADD:目前只有/ bin目录中的python脚本将被find(服务器terminal运行位置)

在WebStorm的同一个项目中使用Angular 1x和Node.js

在WebStorm中,我可以在同一个项目中运行Angular和Node吗? 有没有这样的项目模板? 我还注意到,在我的testing中,节点模块没有被WebStorm的代码检入到存储库(TFS)中。 这是正常的吗? 试图找出最佳实践。