Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angularjs/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Node.js 尝试做angularjs关于流浪者盒子的教程,因果报应不起作用_Node.js_Angularjs_Karma Jasmine - Fatal编程技术网

Node.js 尝试做angularjs关于流浪者盒子的教程,因果报应不起作用

Node.js 尝试做angularjs关于流浪者盒子的教程,因果报应不起作用,node.js,angularjs,karma-jasmine,Node.js,Angularjs,Karma Jasmine,基本上在第一页就卡住了:在安装完文件后,我更改了karma.conf.js,使其使用PhantomJS browsers : ['PhantomJS'], 已安装的PhantomJS: [vagrant@localhost angular-phonecat]$ npm install phantomjs npm http GET https://registry.npmjs.org/phantomjs //... a lot more npm http 503 https://registry

基本上在第一页就卡住了:在安装完文件后,我更改了karma.conf.js,使其使用PhantomJS

browsers : ['PhantomJS'],
已安装的PhantomJS:

[vagrant@localhost angular-phonecat]$ npm install phantomjs
npm http GET https://registry.npmjs.org/phantomjs
//... a lot more
npm http 503 https://registry.npmjs.org/cryptiles
npm ERR! registry error parsing json
npm http 503 https://registry.npmjs.org/assert-plus/0.1.2
npm ERR! registry error parsing json
//... some more
npm http 304 https://registry.npmjs.org/cryptiles

> phantomjs@1.9.7-12 install /var/www/html/hosts/angulartest/angular-phonecat/node_modules/phantomjs
> node install.js

Download already available at /tmp/phantomjs/phantomjs-1.9.7-linux-x86_64.tar.bz2
Extracting tar contents (via spawned process)
Copying extracted folder /tmp/phantomjs/phantomjs-1.9.7-linux-x86_64.tar.bz2-extract-1404194867925/phantomjs-1.9.7-linux-x86_64 -> /var/www/html/hosts/angulartest/angular-phonecat/node_modules/phantomjs/lib/phantom
Writing location.js file
Done. Phantomjs binary available at /var/www/html/hosts/angulartest/angular-phonecat/node_modules/phantomjs/lib/phantom/bin/phantomjs
phantomjs@1.9.7-12 node_modules/phantomjs
├── which@1.0.5
├── progress@1.1.7
├── rimraf@2.2.8
├── kew@0.1.7
├── ncp@0.4.2
├── mkdirp@0.3.5
├── adm-zip@0.2.1
├── request-progress@0.3.1 (throttleit@0.0.2)
├── npmconf@0.0.24 (inherits@1.0.0, once@1.1.1, osenv@0.0.3, ini@1.1.0, semver@1.1.4, nopt@2.2.1, config-chain@1.1.8)
└── request@2.36.0 (json-stringify-safe@5.0.0, forever-agent@0.5.2, qs@0.6.6, aws-sign2@0.5.0, oauth-sign@0.3.0, tunnel-agent@0.4.0, node-uuid@1.4.1, mime@1.2.11, tough-cookie@0.12.1, form-data@0.1.4, http-signature@0.10.0, hawk@1.0.0)
然后开始测试

[vagrant@localhost angular-phonecat]$ npm test

> angular-phonecat@0.0.0 pretest /var/www/html/hosts/angulartest/angular-phonecat
> npm install


> phantomjs@1.9.7-12 install /var/www/html/hosts/angulartest/angular-phonecat/node_modules/phantomjs
> node install.js

Download already available at /tmp/phantomjs/phantomjs-1.9.7-linux-x86_64.tar.bz2
Extracting tar contents (via spawned process)
Copying extracted folder /tmp/phantomjs/phantomjs-1.9.7-linux-x86_64.tar.bz2-extract-1404195014386/phantomjs-1.9.7-linux-x86_64 -> /var/www/html/hosts/angulartest/angular-phonecat/node_modules/phantomjs/lib/phantom
Writing location.js file
Done. Phantomjs binary available at /var/www/html/hosts/angulartest/angular-phonecat/node_modules/phantomjs/lib/phantom/bin/phantomjs

> angular-phonecat@0.0.0 postinstall /var/www/html/hosts/angulartest/angular-phonecat
> bower install


> angular-phonecat@0.0.0 test /var/www/html/hosts/angulartest/angular-phonecat
> karma start test/karma.conf.js

WARN [karma]: Port 9876 in use
WARN [karma]: Port 9877 in use
WARN [karma]: Port 9878 in use
WARN [karma]: Port 9879 in use
WARN [karma]: Port 9880 in use
WARN [karma]: Port 9881 in use
INFO [karma]: Karma v0.10.10 server started at http://localhost:9882/
WARN [launcher]: Can not load "PhantomJS", it is not registered!
  Perhaps you are missing some plugin?
不确定这意味着什么,它说phantomjs既可用又不可用

[更新]

安装karma phantomjs启动器npm安装karma phantomjs启动器后,我必须更改karma.conf.js:

browsers : ['PhantomJS'],

plugins : [
        'karma-phantomjs-launcher',
        'karma-jasmine'
        ],

测试正在运行。

您是否尝试过将karma phantomjs launcher添加到插件列表中?您是否忘记安装karma phantomjs launcher?@AndreyShustariov是的,这和更改karma配置中的插件是成功的。谢谢你们,伊瓦尼你们能用量角器吗?如果是,如何,请一步一步。我对这些都不熟悉tools@ChristopherFrancisco对不起,我还没有试过量角器。