Páginas

Friday, May 10, 2019

Permission errors when trying to install Appium

If trying to install Appium in the classic way we get this error: Error: EACCES: permission denied as you can see in the following example:

mmagni@mmagni-lenovo:~$ sudo npm install -g appium
/usr/bin/appium -> /usr/lib/node_modules/appium/build/lib/main.js
/usr/bin/authorize-ios -> /usr/lib/node_modules/appium/node_modules/.bin/authorize-ios

> appium-chromedriver@4.11.0 install /usr/lib/node_modules/appium/node_modules/appium-chromedriver
> node install-npm.js

(node:5303) UnhandledPromiseRejectionWarning: Error: EACCES: permission denied, mkdir '/usr/lib/node_modules/appium/node_modules/appium-chromedriver/2019410-5303-1pkr3c0.3t64'
(node:5303) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:5303) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
[20:58:15] [Chromedriver Install] Installing Chromedriver version '2.46' for platform 'linux' and architecture '64'
[20:58:15] [Chromedriver Install] Opening temp file to write 'chromedriver_linux64' to...
Error: EACCES: permission denied, mkdir '/usr/lib/node_modules/appium/node_modules/appium-chromedriver/2019410-5303-1jmtk1l.nnoej'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.0.6 (node_modules/appium/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.0.6: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! appium-chromedriver@4.11.0 install: `node install-npm.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the appium-chromedriver@4.11.0 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/mmagni/.npm/_logs/2019-05-10T23_58_16_106Z-debug.log

The solution for this permission issue is to execute the same command but adding the following parameters:

mmagni@mmagni-lenovo:~$ sudo npm install -g appium --unsafe-perm=true --allow-root
/usr/bin/appium -> /usr/lib/node_modules/appium/build/lib/main.js
/usr/bin/authorize-ios -> /usr/lib/node_modules/appium/node_modules/.bin/authorize-ios

> appium-chromedriver@4.11.0 install /usr/lib/node_modules/appium/node_modules/appium-chromedriver
> node install-npm.js

[21:02:23] [Chromedriver Install] Installing Chromedriver version '2.46' for platform 'linux' and architecture '64'
[21:02:23] [Chromedriver Install] Opening temp file to write 'chromedriver_linux64' to...
[21:02:23] [Chromedriver Install] Opened temp file '/tmp/2019410-5611-12mbuip.95vu/chromedriver_linux64.zip'
[21:02:23] [Chromedriver Install] Downloading https://chromedriver.storage.googleapis.com/2.46/chromedriver_linux64.zip...
[21:02:33] [Chromedriver Install] Writing binary content to /tmp/2019410-5611-12mbuip.95vu/chromedriver_linux64.zip...
[21:02:33] [Chromedriver Install] Extracting /tmp/2019410-5611-12mbuip.95vu/chromedriver_linux64.zip to /tmp/2019410-5611-12mbuip.95vu/chromedriver_linux64
[21:02:33] [Chromedriver Install] Creating /usr/lib/node_modules/appium/node_modules/appium-chromedriver/chromedriver/linux...
[21:02:33] [Chromedriver Install] Copying unzipped binary, reading from /tmp/2019410-5611-12mbuip.95vu/chromedriver_linux64/chromedriver...
[21:02:33] [Chromedriver Install] Writing to /usr/lib/node_modules/appium/node_modules/appium-chromedriver/chromedriver/linux/chromedriver_64...
[21:02:33] [Chromedriver Install] /usr/lib/node_modules/appium/node_modules/appium-chromedriver/chromedriver/linux/chromedriver_64 successfully put in place

> appium-selendroid-driver@1.13.3 install /usr/lib/node_modules/appium/node_modules/appium-selendroid-driver
> node ./bin/install.js

[21:02:34] Java version 11.0.3 found
[21:02:34] Ensuring /usr/lib/node_modules/appium/node_modules/appium-selendroid-driver/selendroid/download exists
[21:02:34] Downloading Selendroid standalone server version 0.17.0 from https://repo1.maven.org/maven2/io/selendroid/selendroid-standalone/0.17.0/selendroid-standalone-0.17.0-with-dependencies.jar --> /usr/lib/node_modules/appium/node_modules/appium-selendroid-driver/selendroid/download/selendroid-server-7cf7163ac47f1c46eff95b62f78b58c1dabdec534acc6632da3784739f6e9d82.jar
[21:02:59] Writing binary content to /usr/lib/node_modules/appium/node_modules/appium-selendroid-driver/selendroid/download/selendroid-server.jar.tmp
[21:02:59] Selendroid standalone server downloaded
[21:02:59] Determining AndroidManifest location
[21:02:59] Determining server apk location
[21:03:00] Extracting manifest and apk to /usr/lib/node_modules/appium/node_modules/appium-selendroid-driver/selendroid/download
[21:03:00] Copying manifest and apk to /usr/lib/node_modules/appium/node_modules/appium-selendroid-driver/selendroid
[21:03:00] Cleaning up temp files
[21:03:00] Fixing AndroidManifest icon bug

> appium-windows-driver@1.5.1 install /usr/lib/node_modules/appium/node_modules/appium-windows-driver
> node install-npm.js

Not installing WinAppDriver since did not detect a Windows system
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.0.6 (node_modules/appium/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.0.6: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

+ appium@1.13.0
added 584 packages from 402 contributors in 42.928s

Tuesday, December 19, 2017

Install MongoDB Community Edition in Debian 9

We must install libssl1.0.0 which is not inside Debian 9's official repositories.

Let's execute this commands:

$ wget http://security.debian.org/debian-security/pool/updates/main/o/openssl/libssl1.0.0_1.0.1t-1+deb7u3_amd64.deb
$ sudo dpkg -i libssl1.0.0_1.0.1t-1+deb7u3_amd64.deb
$ sudo apt install dirmngr
$ sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2930ADAE8CAF5059EE73BB4B58712A2291FA4AD5
$ sudo su
# echo "deb http://repo.mongodb.org/apt/debian jessie/mongodb-org/3.6 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.6.list
# exit
$ sudo apt update
$ sudo apt install -y mongodb*

Done!

Thursday, December 14, 2017

ERROR when trying to install the polymer-cli

If you try to install the polymer-cli:

$ sudo npm install -g polymer-cli

...and you get the following error:

Error: EACCES: permission denied, mkdir '/usr/lib/node_modules/polymer-cli/node_modules/wd/build'

You can solve it by running the command with the --unsafe-perm parameter:

$ sudo npm install -g polymer-cli --unsafe-perm

Friday, September 8, 2017

How to make an IFRAME responsive

This problem is solved wrapping the <iframe> with a <div>. The <div> has to have this CSS property:

-webkit-overflow-scrolling:touch;

This would be the complete code:


.wrapper {
    -webkit-overflow-scrolling:touch;
}

<div class="wrapper">
    <iframe ... width="100%"></iframe>
</div>