Npm install not running on the build-server

My app-project is in a sub-folder in my repo so I have a package.json-file in the root with the following scripts:

“scripts”: {
“preinstall”: “cd [dir]/app && sudo npm install --unsafe-perm”,
“install”: “”,
“build”: “cd [dir]/app && npm run build”
}

What’s in preinstall I earlier had in “install”, but I got the same result. The issue is the following:

[00:21:05]: Installing Dependencies
[00:21:05]: $ npm install --quiet --no-optional
[00:21:06]: ▸ npm WARN lifecycle app@0.1.0~preinstall: cannot run in wd app@0.1.0 cd [dir]/app && sudo npm install --unsafe-perm (wd=/builds/solojuve1897/musse)

[dir] = only masking the real path.

I would like to point out that the scripts works fine on my local machine.

Any ideas?