whoami show specific user but program is executed as root

Summary

So this is kinda nasty because this kinda gave wrong impression to users. I know before_scripts run as root, but inside jobs, scripts are executed as root also despite $whoami show specific user

Steps to reproduce

Here is my .gitlab-ci.yml

buildApi:
  only:
    - develop
  script:
    - whoami
    - cd api
    - npm install
  stage: build

Below is the output of build

Running with gitlab-ci-multi-runner 1.7.1 (f896af7)
Using Shell executor...
Running on ip-xxx-xx-x-xx...
Fetching changes...
HEAD is now at 2558447 Update .gitlab-ci.yml
Checking out 2558447c as develop...
$ whoami
gitlab-runner
$ cd api
$ npm install
bash: line 49: npm: command not found
ERROR: Build failed: exit status 1

Although I have nvm & npm installed inside gitlab-runner user, the build failed.
After setting the permissions so that all users can access npm, the build passed

Actual behavior

The script should be executed as specific user

Environment description

Here is my runner config

concurrent = 1
check_interval = 0

[[runners]]
  name = "xxxx"
  url = "https://gitlab.com/ci"
  token = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
  shell = "bash"
  executor = "shell"
  [runners.cache]

ssh executor also exhibits the same behavior

Used GitLab Runner version

$ gitlab-runner  --version
Version:      1.7.1
Git revision: f896af7
Git branch:   1-7-stable
GO version:   go1.7.3
Built:        Tue, 25 Oct 2016 16:57:56 +0000
OS/Arch:      linux/amd64