PhantomJS does not exist Error - phantomjs

I get error PhantomJS does not exist at '/usr/local/phantomjs/bin/phantomjs on the terminal upon running the tests (npm tests) for Cloudboost Javascript SDK repo. Any idea how to fix this?

Install PhantomJS from here, and create a symlink of the downloaded folder in your /usr/local/ directory. Run the command npm test again and that error would be gone.

Related

Cypress : npx cypress open command not working

I have downloaded nodejs and installed and set up in the path environment variable.
Downloaded Vscode and then created a project folder(automation).
From the terminal in the folder , provided the command npx init cypress
and then install cypress
wrote a piece of code and then tried executing npx cypress open, but nothing coming up.
Please advise
The issue has been resolved. Such an issue came because of security app of our organizations

How to run locally installed npm package with npx

I have the following folder structure with the locally installed Cypress module:
cypress-test-project
node_modules
cypress
tests.spec.js
As I read it in this article, npx helps to execute globally and locally installed packages:
Run a locally installed package easily
If you wish to execute a locally installed package, all you need to do
is type:
$ npx your-package
npx will check whether or
exists in $PATH, or in the local project binaries, and if
so it will execute it.
As I have Cypress installed in the node_modules folder, I tried to run the following command:
npx cypress open
This is what I get:
No version of Cypress is installed in:
C:\Users\main\AppData\Local\Cypress\Cache\9.5.1\Cypress
Please reinstall Cypress by running: cypress install
Cypress executable not found at:
C:\Users\main\AppData\Local\Cypress\Cache\9.5.1\Cypress\Cypress.exe
Platform: win32-x64 (10.0.22000) Cypress Version: 9.5.1
Why does npx stop after checking the PATH variable and not looking in the local folder?
Cypress always installs to that user-specific (global) location even if you install locally in the project.
It sounds like the install crashed part way.
Try removing and repeating.

The provided "teamcity" reporter does not exist. Check that you have specified the report format correctly

suddenly the test I have in testcafe stop working.
I have try to reinstall again the teamcity reporter with:
npm install -g testcafe testcafe-reporter-teamcity
and
npm install testcafe testcafe-reporter-teamcity
I can see that I have the folder testcafe-reporter-teamcity in my node_modules. But for some reason it cant find it.
Still the error that I get when running my test in local with the command:
testcafe firefox tests -c 4 --skip-js-errors --reporter teamcity
It will return the error:
ERROR The provided "teamcity" reporter does not exist. Check that you have specified the report format correctly.
Found the issue.
Just downgrading the version to
"testcafe-reporter-teamcity": "1.0.10"
seems to work perfectly.. for some reason 1.0.11 is giving this issue.

Intellij error gulp is not on your path

I'm running a project in intellij that uses gulp.
After running the debug I get this error.
| Error Error executing script RunApp: java.lang.RuntimeException: Problem executing execUiBuild.
standard out: 'Installing npm packages and running gulp.
gulp is not on your path. Make sure it is installed.
Anyone know how to fix this. I have gulp installed on my machine already.
In Intellij you can add Build/Run Configurations.
Depending on where you have Node installed and Gulp the paths will be different but here is where you can enter it for the project.
You can get to this screen by choosing "Run" -> "Edit Configurations"
If you haven't already setup a gulp task you can add one by choosing the + on the very top left of the window.
You can get the path to the installed version of node by doing the following command in a terminal:
which node
if you are using nvm it should return something like:
/Users/YOURUSERNAME/.nvm/v0.12.0/bin/node
Gulp should be in the /lib/node_modules/ folder of node that you have installed:
/Users/YOURUSERNAME/.nvm/v0.12.0/lib/node_modules/gulp
Those are the two paths that you need to get it up and running.

How to install PhantomJS and CasperJS in Window 7?

I have a project that need node.js, PhantomJS and CasperJS.
I have node.js working. I run following commands
npm install phantomjs
npm install casperjs
but that project is not working. It gives the error:
casperjs module not found
Can anybody tell me what to do?
Following things/steps help me to install and run casperjs on my windows machine properly:
Requirements:
Node Package Manager
PhantomJS
step 01: Install node package manager by following this simple 4 min video
step 02: Install phantomJS using the following command npm install phantomjs2. Check this link for more details.
step 03: Run the following command npm install casperjs
To get the phantomjs and casperjs module in command line, add this to windows bin path. To edit the bin path follow this:
Right click on my computer and click on Properties
go to advanced system settings
click Enviroment variables
from system variables section, select path and click on Edit
now add caseperjs and phantomjs path like this at the end of path variable: ;C:\WINDOWS_GLOBAL_NODE_MODULES_PATH\casperjs\bin;C:\WINDOWS_GLOBAL_NODE_MODULES_PATH\phantomjs\bin. where WINDOWS_GLOBAL_NODE_MODULES_PATH = Your machine node modules path.
To get this path run npm list -g. First line of the command output is the path.
Now you are all set and check the casperjs command in command line.
Note: NPM is the best tool for javascript based development. so once
you set it up, every new thing is easy to setup.
The casperjs#1.1.0-beta3 package depends on phantomjs>=1.8.2. If you installed CasperJS earlier, it will try to install CasperJS with the PhantomJS version from before. In my case that was phantomjs#1.9.6-0 which is not possible to install through NPM anymore.
You need to clear the npm-cache for the casperjs package. Go to C:\users\{you}\AppData\Roaming\npm-cache and delete the casperjs folder. Now when you try to install CasperJS, it will fetch the newest NPM package of PhantomJS which is currently 1.9.16 (it is PhantomJS 1.9.8). This won't get you much though, because
PhantomJS and CasperJS make really only sense when installed globally. You can do this for example with npm:
npm -g install phantomjs
npm -g install casperjs
Or completely skip the PhantomJS step, because CasperJS will fetch its own PhantomJS dependency.
If you want to try PhantomJS 2 (CasperJS 1.1.0-beta3 only supports PhantomJS 1.x), then you will need to install everything yourself. Download PhantomJS 2 from the official page and put the executable into a directory which is in the PATH environment variable.
Then install CasperJS from git and put its path into the PATH environment variable.