Error: Cannot find module 'jasmine-allure-reporter' - protractor

I m new in using protractor for testing. I want to extract reports with jasmine-allure-report module.
I already run some tests using protractor with visual studio code.
I install it in my ubuntu PC following the instructions from https://www.npmjs.com/package/jasmine-allure-reporter.
When I run the command protractor ./conf/conf.js I get the error :
Error: Error: Cannot find module jasmine-allure-reporter
When I run the command npm list -g jasmine-allure-reporter I get that :
/usr/local/lib
├── jasmine-allure-reporter#1.0.2
├─┬ npm#6.13.7
│ └── jasmine-allure-reporter#1.0.2
└─┬ protractor#5.4.2
└── jasmine-allure-reporter#1.0.2
Does anyone knows why happen that?
Thank you

Install jasmine-allure-reporter in your project root directory using the below command.
npm i --save jasmine-allure-reporter

Related

pip: install a package from a github source subdirectory

I am trying to install a Python package from a source directory in a github repo. With accordance to the Python Packaging Manual, The source directory contains a setup.cfg instead of the old setup.py.
Code
My code follows the Python Packaging Tutorial - a parent directory which contains the metadata, and a src subdirectory which contains a sub-subdirectory with the package itself with and __init__.py file. It's available on https://github.com/adamatan/github-packages-python.
Installing locally - either by building a local dist and wheel using python -m build, and installing the wheel with pip install <path_to_wheel>, or by installing the source using `pip install packaging_tutorial - works well.
.
├── Dockerfile
├── LICENSE
├── Makefile
├── README.md
└── packaging_tutorial
├── LICENSE
├── README.md
├── build_and_publish.sh
├── pyproject.toml
├── setup.cfg
└── src
└── example_package
├── __init__py
└── example.py
What Have I Tried
SSH Install
pip install git+ssh://git#github.com/adamatan/github-packages-python.git#egg=packaging_tutorial
Collecting packaging_tutorial
Cloning ssh://****#github.com/adamatan/github-packages-python.git to /private/var/folders/ty/43hxrncx4nl9n34kmq3w84300000gn/T/pip-install-oc4il6j7/packaging-tutorial_8d95646df03e40dab7f341209c8e71f5
Running command git clone -q 'ssh://****#github.com/adamatan/github-packages-python.git' /private/var/folders/ty/43hxrncx4nl9n34kmq3w84300000gn/T/pip-install-oc4il6j7/packaging-tutorial_8d95646df03e40dab7f341209c8e71f5
ERROR: File "setup.py" not found for legacy project packaging_tutorial from git+ssh://****#github.com/adamatan/github-packages-python.git#egg=packaging_tutorial.
HTTPS install
pip install git+https://github.com/adamatan/github-packages-python.git#egg=packaging_tutorial
Collecting packaging_tutorial
Cloning https://github.com/adamatan/github-packages-python.git to /private/var/folders/ty/43hxrncx4nl9n34kmq3w84300000gn/T/pip-install-sgke7nr1/packaging-tutorial_61f519a8caca48cea01fe22fd5438936
Running command git clone -q https://github.com/adamatan/github-packages-python.git /private/var/folders/ty/43hxrncx4nl9n34kmq3w84300000gn/T/pip-install-sgke7nr1/packaging-tutorial_61f519a8caca48cea01fe22fd5438936
ERROR: File "setup.py" not found for legacy project packaging_tutorial from git+https://github.com/adamatan/github-packages-python.git#egg=packaging_tutorial.
My Question
How can I install the example_package package from its source on Github?
The solution is simple - I just had to use the subdirectory flag instead (or in addition to) the egg one.
So:
pip install git+ssh://git#github.com/adamatan/github-packages-python.git#subdirectory=packaging_tutorial
pip install git+https://github.com/adamatan/github-packages-python.git#subdirectory=packaging_tutorial
Or:
pip install "git+ssh://git#github.com/adamatan/github-packages-python.git#subdirectory=packaging_tutorial&egg=example-pkg-adamatan"
Quoting the manual:
pip looks at 2 fragments for VCS URLs:
egg: For specifying the “project name” for use in pip’s dependency
resolution logic. eg: egg=project_name
subdirectory: For specifying the path to the Python package, when it
is not in the root of the VCS directory. eg: pkg_dir

sys.path behavior in vscode insiders is not equivalent to jupyter lab when using a virtual env

When switching to vscode-insiders notebooks instead of jupyter lab, I noticed that importing my local src package installed using setuptools was not possible anymore, it throws a ModuleNotFoundError.
After comparing the two IDEs, it seems like vscode does not change sys.path as jupyter lab does.
My project architecture:
foo
└── bar
└── myproject
├── notebooks
│   └── nb.ipynb
├── setup.py
├── env
└── src
My installation steps:
cd /foo/bar/myproject
source env/bin/activate
(env) python3 -m pip install -e .
(env) python3 -m ipykernel install --user --name=my_project_env # add the jupyter kernel based on the environment
Then opening nb.ipynb in both jupyterlab and vscode and checking sys.path gives the following:
jupyter lab:
print(sys.path)
-->
...
foo/bar/myproject # allows to import src
...
vscode:
print(sys.path)
-->
...
foo/bar/myproject/notebooks # does not allow to import src
...
I would have expected vscode to add the foo/bar/myproject directory to sys.path as it is the one where src is located, am I getting something wrong?
(In the meantime I found the following workaround, adding the following to my settings.json in vscode:
"jupyter.runStartupCommands": [
"import sys",
"sys.path.insert(2,'${workspaceFolder}')"
]
)

npm WARN deprecated minimatch#2.0.10: Please update to minimatch 3.0.2

$ npm update minimatch#3.0.2
$ npm update -d
npm info it worked if it ends with ok
npm info using npm#2.11.3
npm info using node#v0.12.7
npm info attempt registry request try #1 at 5:33:55 PM
npm http request GET https://registry.npmjs.org/jshint
npm http 200 https://registry.npmjs.org/jshint
npm info ok
$ npm install jshint
npm WARN deprecated minimatch#2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated minimatch#0.3.0: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
jshint#2.9.2 node_modules\jshint
├── strip-json-comments#1.0.4
├── exit#0.1.2
├── shelljs#0.3.0
├── console-browserify#1.1.0 (date-now#0.1.4)
├── lodash#3.7.0
├── minimatch#2.0.10 (brace-expansion#1.1.5)
├── htmlparser2#3.8.3 (domelementtype#1.3.0, entities#1.0.0, domhandler#2.3.0, d omutils#1.5.1, readable-stream#1.1.14)
└── cli#0.6.6 (glob#3.2.11)
npm install -g minimatch#3.0.2
try this....Should Work
Sorry for the late reply..
sudo npm install
Try this..this works For me to install npm
To update use this..
sudo npm install -g npm#3
Try this (for OSX)
Enter Into Terminal sudo chown -R $USER /usr/local
Works for me downgrading to node v4.4.7 and with sudo chown -R $USER /usr/local in terminal.
I can fix it.
npm install minimatch
+ minimatch#3.0.4
sudo npm install -g minimatch#3.0.4
Try this. It run good for me.
Here, I worked in reactJS with bebel script and try to install npm in my directory. At that time I found this error. I have solved this error by below command.
Run this command in cmd:
npm install browserify babelify babel-preset-env
While chown is one way of going about this, I've always regarded it as the least favorable. Rather than change the owner of system files, it makes more sense to run npm config set prefix $HOME/.node_modules. This will configure npm to look for your node_modules in your home directory, rather than globally.
See https://docs.npmjs.com/getting-started/fixing-npm-permissions.

jspm hot reloading install - command not found after global install

i try to install the hot reload module of jspm using the chokidar-socket-emitter. Installation works like charme, but after that it is not possible to start the watch task as described here: http://jspm.io/0.17-beta-guide/hot-reloading.html
Here is my install log:
XXXXXMacBookPro:dasding xxxxxx$ sudo npm i -g chokidar-socket-emitter
\
fsevents#1.0.12 install /usr/local/lib/node_modules/chokidar-socket-emitter/node_modules/chokidar/node_modules/fsevents
node-pre-gyp install --fallback-to-build
[fsevents] Success: "/usr/local/lib/node_modules/chokidar-socket-emitter/node_modules/chokidar/node_modules/fsevents/lib/binding/Release/node-v14-darwin-x64/fse.node" is installed via remote
chokidar-socket-emitter#0.3.1 /usr/local/lib/node_modules/chokidar-socket-emitter
├── socket.io#1.4.6 (has-binary#0.1.7, debug#2.2.0, socket.io-parser#2.2.6, socket.io-adapter#0.4.0, engine.io#1.6.9, socket.io-client#1.4.6)
└── chokidar#1.5.2 (path-is-absolute#1.0.0, inherits#2.0.1, glob-parent#2.0.0, async-each#1.0.0, is-binary-path#1.0.1, is-glob#2.0.1, readdirp#2.0.0, anymatch#1.3.0, fsevents#1.0.12)
XXXXXMacBookPro:dasding xxxxxx$ chokidar-socket-emitter
bash: chokidar-socket-emitter: command not found
XXXXXMacBookPro:dasding xxxxxx$
Does anyone has any idea why he is unable to find the command? i have no idea how to fix this, global installs always used to work without any problem.
thanks in advance
Ok, in case someone faces the same problem - my current node.js installation was unable to handle the latest version of chokidar-socket-emitter, so a lower version was installed, but the docs refered to the latest version, so there never was a command that could have been found. after updating my node.js installation everything worked like charme.

"coffee" command fails silently, how to debug?

When using coffee-script this command runs ok on 1 computer but silently fails on another.
coffee --output dir --compile dir
make: *** [js] Error 1
How can I debug? Any flags for verbose output?
npm list -g
/usr/local/lib
├─┬ coffee-script#1.7.1
│ └── mkdirp#0.3.5
├── csso#1.2.15
└── uglify-js#1.3.2
Even coffee --version fails with no output
It was a terrible mix of old Ubuntu's/new packages.
Needed to remove node, nodejs packages.
Install new versions from PPA
sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install python-software-properties python g++ make nodejs
Reinstall coffee-script: sudo npm install coffee-script -g
Thanks