NPM browserstack alias installed by package.json for TestCafe not recognized - jenkins

Installing 'testcafe-browser-provider-browserstack' by package.json causes Jenkins job not to recognize 'browserstack'
Tried removing from package.json and install from command line but dependencies cause npm install to error.
testcafe 1.1.4
testcafe-browser-provider-browserstack 1.8.0
npm install
node_modules/.bin/testcafe -e browserstack:safari auth-subscriber-access-myaccount.js
ERROR Unable to find the browser. "browserstack:safari" is not a browser alias or path to an executable file.

One way to debug the issue would be to run the test explicitly with your BrowserStack credentials with the following command -
BROWSERSTACK_USERNAME="YOUR_USERNAME" BROWSERSTACK_ACCESS_KEY="YOUR_KEY" testcafe "browserstack:safari#12.0:OS X Mojave" "path/to/test/file.js"

I tried different paths and also moving to devDependencies in package.json but wasn't successful. I removed from package.json and installed command line at run time and it works.
Maybe I didn't find the right path to call it or it needs to be "local" installed but it now recognizes 'browserstack' this way.

Related

I tried to install Pupilfirst LMS

I tried to install Pupilfirst LMS, I had difficulty in step
Compile Rescript Code: yarn run re: build
Output: Usage Error: could't find a script named "re: build".
And I also have difficulty in step
Run Webpack Dev Server: yarn run wds
Output: Usage Error: could't find a script named "wds".
is there any solution?
https://docs.pupilfirst.com/developers/development_setup
There shouldn't be a space between re: and build: yarn run re:build.
Also, when running a yarn run script_name command, make sure that your current directory contains a package.json file where the script script_name is defined.
In case of pupilfirst this file is in the root: https://github.com/pupilfirst/pupilfirst/blob/e41ffb8a57f4c59f7927056af324b5c283fb0038/package.json

Explanation and best practise around yarn - warning Integrity check: System parameters don't match

When I was building and trying to run my docker image with a rubyonrails app, I was getting this error:
warning Integrity check: System parameters don't match
error Integrity check failed
error Found 1 errors.
I tried changing my Docker file with
RUN yarn install --check-files
But that didn't do anything.
I then just deleted the yarn.lock file and my container now runs.
I am guessing the issue is that rails was run locally on my laptop, and now it is trying to run the same yarn.lock file on another computer and the integrity check is failing? Is this correct?
What should my dockerfile be doing? Should I exclude the yarn.lock file from getting into my docker container in the first place?
First of all, you will need to remove the node_modules folder and run the yarn install again. In your command line, follow these instructions:
Remove node_modules folder by typing rm -rf node_modules
Run yarn install
Run rails webpacker:install
Restart your command-line editor.
Be careful about the NodeJS version in your machine. It must be the same as the version in which the rails project was initialized. You can use nvm to manage the Node version.
Add "config.webpacker.check_yarn_integrity = false" in "development.rb" will solve the problem
I would suggest not copying yarn.lock in the container. You can add yarn.lock in the .dockerignore which Docker will ignore the yarn.lock while building the image.
I had faced similar issues because, locally I run on macOS and containers are alpine-based, so we end up ignoring the yarn.lock

Build executable for windows with Vue CLI Plugin Electron Builder in linux

I'm trying to build an executable file for windows from my linux but so far I have not been able to do it.
According to the documentation, it tells me that here I could configure, for example, the output folder.
pluginOptions: {
electronBuilder: {
outputDir: 'desktop-for-windows',
},
},
and if it works but does not say anything about how to change the platform (s.o) to build.
also try testing the following command:
npm run electron:build --win
but by default it builds for linux
Ran into same thing trying to move from an older boiler plate to using Vue-CLI 3 just now.
Run this from within the project directory and see if it works:
./node_modules/.bin/vue-cli-service electron:build --windows
I got the --windows from the ui.js file in the vue-cli-plugin-electron-builder directory under node_modules. Other options are --linux and --macos. I'm surprised I don't see a --all flag or that all isn't the default.
If you add "build:win": "vue-cli-service electron:build --windows" under scripts in your package.json then you can instead run npm run build:win from there on.
I just faced the same problem and found pretty easy answer.
You can just run npm run electron:build -- --linux deb --win nsis in the project directory.
There is more about it here: https://nklayman.github.io/vue-cli-plugin-electron-builder/guide/recipes.html#multi-platform-build

Not able to run angular material docs on locally

Environment: Windows 7, npm 2.11.3, bower 1.4.1, gulp CLI 3.9.0
I Cloned angular material (https://github.com/angular/material/tree/v0.10.1) using WebStorm. I followed the (https://github.com/angular/material/tree/v0.10.1/docs) to install angular-material locally.
At root directory /
I run npm install it runs (with some warnings) and downloaded its dependencies (my npm -v is 2.11.3)
In run bower install but its gives following
D:\material>bower install
bower ENOENT No bower.json present
then I run gulp docs to build docs, it was build and created /dist folder at root directory. after I run the gulp server command to live reload. Its said Webserver started at http://0.0.0.0:8080 I saw on bower but no luck, also tried alternativly as http://localhost:8080 still there is no luck.
One more alternative using httpster, I installed it and run httpster -p 8080 -d ./dist/docs it said Starting HTTPster v1.0.1 on port "8080" from ./dist/docs
again i browse localhost:8080 then its gives me error in index page on developer tool of crome as below
Uncaught Error: [$injector:nomod] http://errors.angularjs.org/1.4.3/$injector/nomod?p0=material.components.menu
angular.js:4369 Uncaught Error: [$injector:modulerr] http://errors.angularjs.org/1.4.3/$injector/modulerr?p0=docsApp&p1=Error%3A…ogleapis.com%2Fajax%2Flibs%2Fangularjs%2F1.4.3%2Fangular.min.js%3A19%3A339)
Please help what can I do to get my luck.
Paul (ngmaterial group on google) solved my problem, However site is loading demo pages not working.
Try renaming _menu.js in material-0.10.1\src\components\menu to menu-a.js. In my case that ensured the two js files were added in the correct order.

jhipster application files generated in wrong directory

When I try to create a jhipster application in ubuntu 13.10 with yo jhipster the generated output files are always dumped in the wrong directory.
For example I run yo jhipster in the directory /mnt/mercury/jhipster-test/alpha then the files are dumped out to /mnt/mercury. In fact if I run yo jhipster in any subdirectory of /mnt/mercury they are always dumped out to /mnt/mercury.
I'm using yo version 1.1.2 from the standard ubuntu repository
Please advise how to generate files to be output in current directory.
For the benefit of anyone else facing this problem.
I managed to get Yeoman working with the following
npm cache clean
sudo npm rm -g yo
npm cache clean
sudo npm install -g yo
My problem: Accidentally "yo generating" in the parent directory.
Solution: Delete the .yo-rc.json file in the parent directory, then running the yo generator command in the child directory.
As discussed in the comments, this is a Yeoman problem on Ubuntu 13.10:
We don't have this issue with Ubuntu 12.04
There is the same issue with other generators ("yo webapp") on Ubuntu 13.10
As a workaround, I recommend you have a look at our Docker container:
https://github.com/jhipster/jhipster-docker
This will allow you to run the full JHipster stack, with Ubuntu 12.04, inside a container! Just use it to generate the app, then you can work directly on your host machine.
On Mac OSX Maverick with Node v0.10.26, yo v1.1.2 and generator-jhipster v0.11, the yo hipster command was generating all the sources always in the same (wrong!) directory and not using my current directory.
I fixed this problem doing the following:
cd <WRONG_DIR_WHERE_CODE_IS_CREATED>
rm .yo-rc.json node_modules/
npm uninstall -g karma
npm install -g karma (Note: using sudo it was not working!)
sudo npm install -g generator-jhipster
Not sure why but I've then been able to install karma and generator-jhipster again and suddenly yo hipster starting generating code again in my current directory
Could it be caused by different environment variables when launching npm with sudo?
The file .yo-rc.json is hidden, if it is not deleted, the generator will constantly take the settings from it. You must delete .yo-rc.json.

Resources