我有一个带有一些测试的node.js项目(这是我自己的测试框架)。
该项目的结构如下:
app.js
tests
- test1.js
- test2.js
在app.js文件中,我有一个特殊的设置,允许我指定运行测试的路径。如果我从终端运行以下命令:
`node app.js` all tests from the tests folder will be run
如果我从终端运行以下命令:
`node app.js ./tests/test1.js` - only the specific file will be run
我想从IDE运行这些测试(我需要运行所有的测试或
我的应用程序是用mean.js开发的,它有管理和门户。目前的管理方式是在3000端口运行,在4000端口运行。但现在我想在3000中运行管理,在3001中运行门户。默认情况下,测试(Jasmine & mocha)运行在5858端口,我无法运行我的应用程序,它显示了一个错误
Error: listen EADDRINUSE :::3000
at Object.exports._errnoException (util.js:907:11)
at exports._exceptionWithHostPort (util.js:930:20)
at Server._
我已经成功地在Ec2上安装了节点js,并且我的网站和域运行良好,但是当我尝试运行节点js时,它不会运行。
我已经遵循了一些教程,我已经完成了以下步骤,我的aws。
1. I have added a port 9000 on my security group
2. I have done the pre-routing on iptables using below command
sudo iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 9000
但是在运行以上代码之后,我的域停止运行
我试图使用库获得运行示例的节点:
安装后,我通过节点repl运行代码(我通过从终端运行‘节点’启动repl ):
var keyPair = bitcoin.ECPair.makeRandom()
但接收错误:
ReferenceError: bitcoin is not defined
at repl:1:15
at REPLServer.defaultEval (repl.js:262:27)
at bound (domain.js:287:14)
at REPLServer.runBound [as eval] (domain.js:300:12)
我正在尝试使用requirejs优化器,但是我得到了以下错误:
从节点运行:
$ node r.js js/main.js -o build.js
Error: Evaluating js/app/main.js as module "app/main" failed with error:
Error: Evaluating js/lib/jquery-1.8.0.js as module "jquery" failed
with error: ReferenceError: window is not defined
从java运行
$ java -cl
当我尝试运行npm run start o node server.js时,在运行节点server.js之前,我运行npm prune && npm install,我使用节点js生成了这个错误(‘./.env’)
module.js:478
throw err;
Error: Cannot find module './*.env'
at Function.Module._resolveFilename (module.js:476:15)
at Function.Module._load (module.js:424:25)
at