简体   繁体   English

在Mac上找不到Angular量角器/cli.js文件被告知检查我如何安装量角器

[英]Could not find Angular protractor /cli.js file on mac was told check how I Installed Protractor

I have a massive headache trying to find protractor/built/cli.js file in protractor. 尝试在量角器中找到量角器/built/cli.js文件时,我非常头疼。 I would really appreciate a second opinion. 我真的很感谢第二意见。

To locate the cli.js file, I did the following syntax. 为了找到cli.js文件,我执行了以下语法。

/usr/local/lib/node_modules/npm/node_modules

I was expecting to find a protractor file in this location. 我期待在此位置找到量角器文件。 However, I didn't. 但是,我没有。 So I spoke to a person helping me with the protractor in this video here . 因此,我在此视频中与一个帮助量角器的人进行了交谈。

I clearly outlined the problem and what I was experiencing. 我清楚地概述了问题和遇到的问题。

The response was asked ' how did I installed protractor? 回答是“ 我如何安装量角器? ' I told him I installed protractor the standard way using npm install -g protractor command. '我告诉他我使用npm install -g protractor命令以标准方式安装了量角器。

His response was ' if installed it should show in node modules '. 他的回答是“ 如果安装,它将显示在节点模块中 ”。 This response is very confusing to me. 这个回应令我非常困惑。

I don't understand what he is trying to say because it's not in nodes modules 我不明白他想说什么,因为它不在节点模块中

So my question is pretty straightforward: 所以我的问题很简单:

1. Should I run the npm install -g protractor command again so I can find the location? 1.是否应该再次运行npm install -g protractor命令,以便找到位置?

2. If 1 is not a good idea, how to do I find the protractor file so I can find the cli.js file location so I can run my angular test cases. 2.如果不是一个好主意,那么如何找到量角器文件,以便可以找到cli.js文件的位置,以便运行我的角度测试用例。

Because you install protractor as global package, you need to figure out the install folder path for global package via executing following cmd: npm prefix -g 因为将量角器安装为全局软件包,所以需要通过执行以下cmd来找出全局软件包的安装文件夹路径: npm prefix -g

It will print out a folder path which is the global package install folder. 它将打印出一个文件夹路径,即全局软件包安装文件夹。 Then you can find build/cli.js from 然后您可以从中找到build/cli.js

<global package install folder>/lib/node_modules/protractor/build/cli.js

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM