I am trying to learn k6 and I started with its official documents. I tried the sample code in run document with both docker image and command-line. In the docker version it works fine:
zeinab@ZiZi:~$ docker run -i loadimpact/k6 run - <k6_test.js
      /\      |‾‾|  /‾‾/  /‾/   
     /\  /  \     |  |_/  /  / /    
    /  \/    \    |      |  /  ‾‾\  
   /          \   |  |‾\  \ | (_) | 
  / __________ \  |__|  \__\ \___/ .io
  execution: local--------------------------------------------------]   servertor
     output: -
     script: -
    duration: -, iterations: 1
     vus: 1, max: 1
time="2020-02-18T11:14:26Z" level=info msg=Running i=0 t=971.124809ms starting
...
time="2020-02-18T11:14:55Z" level=info msg=Running i=0 t=29.971104099s
time="2020-02-18T11:14:55Z" level=warning msg="Request Failed" error="Get http://test.loadimpact.com: proxyconnect tcp: dial tcp 192.168.14.109:1087: i/o timeout"
time="2020-02-18T11:14:56Z" level=info msg=Running i=0 t=30.971060995s
time="2020-02-18T11:14:56Z" level=info msg="Test finished" i=1 t=31.000143344s
    data_received..............: 0 B 0 B/s
    data_sent..................: 0 B 0 B/s
    http_req_blocked...........: avg=0s  min=0s  med=0s  max=0s  p(90)=0s  p(95)=0s 
    http_req_connecting........: avg=0s  min=0s  med=0s  max=0s  p(90)=0s  p(95)=0s 
    http_req_duration..........: avg=0s  min=0s  med=0s  max=0s  p(90)=0s  p(95)=0s 
    http_req_receiving.........: avg=0s  min=0s  med=0s  max=0s  p(90)=0s  p(95)=0s 
    http_req_sending...........: avg=0s  min=0s  med=0s  max=0s  p(90)=0s  p(95)=0s 
    http_req_tls_handshaking...: avg=0s  min=0s  med=0s  max=0s  p(90)=0s  p(95)=0s 
    http_req_waiting...........: avg=0s  min=0s  med=0s  max=0s  p(90)=0s  p(95)=0s 
    http_reqs..................: 1   0.032258/s
    iteration_duration.........: avg=31s min=31s med=31s max=31s p(90)=31s p(95)=31s
    iterations.................: 1   0.032258/s
    vus........................: 1   min=1 max=1
    vus_max....................: 1   min=1 max=1
But when running from command-line, I get:
zeinab@ZiZi:~$ sudo k6 run ./k6_test.js
          /\      |‾‾|  /‾‾/  /‾/   
     /\  /  \     |  |_/  /  / /    
    /  \/    \    |      |  /  ‾‾\  
   /          \   |  |‾\  \ | (_) | 
  / __________ \  |__|  \__\ \___/ .io
ERRO[0000] open /home/zeinab/k6_test.js: permission denied 
EDIT 1:
I get the same error when running with current user:
k6 run ./k6_test.js
EDIT 2:
I installed k6 using snap:
zeinab@ZiZi:~$ snap install k6 
k6 v0.23.1 from Null Box (nullboxorg) installed