加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

angularjs – Karma无法找到模块’乐观主义者’

发布时间:2020-12-17 18:00:50 所属栏目:安全 来源:网络整理
导读:我正在尝试安装角度电话猫应用程序并使用karma测试运行器运行测试用例.我安装了节点v0.10.33.我在全球范围内安装了业力.现在,我试图用’npm test’运行测试用例,我得到以下错误: module.js:340 throw err; ^Error: Cannot find module 'optimist' at Functi
我正在尝试安装角度电话猫应用程序并使用karma测试运行器运行测试用例.我安装了节点v0.10.33.我在全球范围内安装了业力.现在,我试图用’npm test’运行测试用例,我得到以下错误:

module.js:340
    throw err;
          ^
Error: Cannot find module 'optimist'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (C:meangular-phonecatnode_moduleskarmalibcli.j
s:2:16)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)

任何的想法 ?我认为可能是业力没有正确初始化我试图运行’karma init’但同样的错误再次.

更新—–

运行’npm install’时出现以下错误:

npm WARN unmet dependency C:meangular-phonecatnode_moduleskarma requires s
ocket.io@'~0.9.13' but will load
npm WARN unmet dependency C:meangular-phonecatnode_modulessocket.io,npm WARN unmet dependency which is version 1.2.0
npm WARN unmet dependency C:meangular-phonecatnode_moduleskarma requires g
lob@'~3.2.7' but will load
npm WARN unmet dependency C:meangular-phonecatnode_modulesglob,npm WARN unmet dependency which is version 4.1.4
npm WARN unmet dependency C:meangular-phonecatnode_moduleskarma requires m
inimatch@'~0.2' but will load
npm WARN unmet dependency C:meangular-phonecatnode_modulesminimatch,npm WARN unmet dependency which is version 1.0.0
npm WARN unmet dependency C:meangular-phonecatnode_moduleskarma requires u
seragent@'~2.0.4' but will load
npm WARN unmet dependency C:meangular-phonecatnode_modulesuseragent,npm WARN unmet dependency which is version 2.1.2
npm WARN unmet dependency C:meangular-phonecatnode_moduleskarma requires c
onnect@'~2.12.0' but will load
npm WARN unmet dependency C:meangular-phonecatnode_modulesconnect,npm WARN unmet dependency which is version 3.3.3
npm WARN unmet dependency C:meangular-phonecatnode_modulesbowernode_modul
eshandlebars requires optimist@'~0.3' but will load
npm WARN unmet dependency C:meangular-phonecatnode_modulesoptimist,npm WARN unmet dependency which is version 0.6.1
npm WARN unmet dependency C:meangular-phonecatnode_modulesbowernode_modul
esbower-registry-clientnode_modulesrequestnode_modulesform-data requires as
ync@'~0.9.0' but will load
npm WARN unmet dependency C:meangular-phonecatnode_modulesbowernode_modul
esbower-registry-clientnode_modulesasync,npm WARN unmet dependency which is version 0.2.10
npm WARN unmet dependency C:meangular-phonecatnode_modulesbowernode_modul
esinsightnode_modulesinquirernode_modulescli-colornode_modulesd requires
es5-ext@'~0.10.2' but will load
npm WARN unmet dependency undefined,npm WARN unmet dependency which is version undefined
npm WARN unmet dependency C:meangular-phonecatnode_modulesbowernode_modul
esinsightnode_modulesinquirernode_modulescli-colornode_modulestimers-ext
requires es5-ext@'~0.10.2' but will load

解决方法

在运行npm install之前尝试执行后续步骤

>从项目中删除文件夹node_modules>运行npm cache clean>运行npm install

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读