protractor cant find cli.js file - protractor

I just installed protractor and the default repo along with webdriver. Every time I run protractor I get this error
module.js:340
throw err;
^
Error: Cannot find module '/usr/local/lib/node_modules/protractor/lib/cli.js'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:901:3
Not sure how to fix this... any clues?

Try to use the following solution :
under Configuration , use this for javascript file = /usr/lib/node_modules/protractor/lib/cli.js
I faced similar issue , it got resolved . I am using WebStorm in linux environment .
Make sure you installed protractor on the global position , by using this command :
sudo npm install -g protractor
sudo webdriver-manager update
webdriver-manager start

Got stuck similarly ... this worked for me.
Make sure to have "node_modules" & "node_modules/.bin" in the project folder, you can generate them by
running "npm install protractor" on the project root folder and then get rid of it "protractor" folder by running "npm uninstall protractor".

Related

Error: Error: Cannot find module 'cucumber'

I am trying to execute a small example of automated test using Webstorm, cucumber and protractor.
I have already installed cucumber using this command within the root of the project:
sudo npm install -g cucumber
I have already created the conf.js file and when running this command within the prompt:
> protractor conf.js
Finally, the output is:
*
[13:13:18] E/launcher - Error: Error: Cannot find module 'cucumber'
at Function.Module._resolveFilename (module.js:547:15)
at Function.Module._load (module.js:474:25)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at Object.module.exports.load (/Users/alfredo.bazo/node_modules/protractor-cucumber-framework/lib/cucumberLoader.js:19:24)
at Object.<anonymous> (/Users/alfredo.bazo/node_modules/protractor-cucumber-framework/index.js:8:33)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
[13:13:18] E/launcher - Process exited with error code 100
I have no idea what else I can do, any suggestions?
There are two approach to resolve your problem, and recommend to use approach 1).
1) install cucumber as project local package, rather than global package.
npm install -S cucumber
2) install cucumber as global package, and you need to add below Environment variable to tell node.exe where to find and load global package.
NODE_PATH=<npm global package install folder path on your machine>
you can execute npm config get prefix which will print out the global package install folder path.
Important: After add environment variable, you need to try in new opened cmd/terminal window.
how to overcome this :try to share video please regarding this query : ...
install cucumber as global package, and you need to add below Environment variable to tell node.exe where to find and load global package.
NODE_PATH=
you can execute npm config get prefix which will print out the global package install folder path.
Important: After add environment variable, you need to try in new opened cmd/terminal window.

Running Testrpc and truffle from powershell not working

I was installing some modules/packages needed for Ethereum development and I previously installed truffle and testrpc, and I could run them fine from PowerShell. I am now suddenly unable to run either as it says 'testrpc' is not recognised as a cmdlet, and 'truffle' is not recognised as a cmdlet. I would appreciate some help on how/why this happened and how to fix it. I also tried restarting my device but that did not help.
Error produced when I run the script/command
If it was working alright previously, uninstalling and reinstalling truffle should work.
npm uninstall -g truffle
npm install -g truffle
In case this does not work, below will work.
run npm init #this will make a new npm project particularly package.json
run npm i truffle #this will download node modules
run ./node_modules/.bin/truffle init #this will create a truffle project

Missing Module in gulpfile 'clone-stats'

I am working with ionic and my ionic build android command isn't working.
The error message I get is "Uh oh! Looks like you're missing a module in your gulp file: Cannot find module 'clone-stats'
Do you need to run 'npm install'?
I highlighted my steps in the image below:
I have no idea what 'clone-stats' is and why it is missing. It was working yesterday.
I have tried to reinstall ionic. I tried npm install -g. I tried removing and adding the android platform back. ionic serve gives me the same error.
I am not familiar with gulp. Does anybody know the problem?
Thanks.
You have required to install 'clone-stats' module.
open terminal
go to your project folder and type npm install clone-stats.
if you facing permission error then use sudo npm install clone-stats
hope it's work for you..

Getting error while running "yo jhipster-ionic"

I am new in jhpster-ionic, following this link:
https://www.npmjs.com/package/generator-jhipster-ionic
Everything was fine until I ran this command:
"yo jhipster-ionic --force" in an empty folder.
After running this command, I am getting this error:
Can anyone please help?
Install the dependencies of generator-jhipster-ionic. Change directories to D:\works\jhipster\chharkoi2\chharkoi2\node_modules\generator-jhipster-ionic and run npm install. These dependencies are normally installed when you install a package through npm.

Install ionic framework.

I have installed the module with node version v0.10.22
sudo npm install -g ionic
But know when I am trying to start an new application I am getting a
-bash command not found
which ionic
gives me nothing, do I have to add the path to on the $PATH variable ?
How did you installed npm? If you used homebrew then npm won't put npm files accessible by users.
Add export PATH=/usr/local/share/npm/bin:$PATH to your .bashrc/.bash_profile/.zshrc file and it should work fine.
Also refer this: Bower: "command not found" after installation