Drone

Permission denied

Hello,

I’m trying to execute some tests with my node application, but after I make “npm install” (which runs fine), I run “npm test” I got some permission error (as you can see bellow):

sh: 1: react-scripts: Permission denied

Here is my drone.yml

kind: pipeline
type: kubernetes
name: pipeline-pull-request

trigger:
  event:
    - pull_request

steps:
- name: test
  image: node
  commands:
  - npm install
  - npm test

I’m running everything inside kubernetes.

There is anything that I’m missing to execute/configure?

Thanks!

perhaps this thread is relevant to your issue?

1 Like

Oh It was almost related. Haha. But I fixed :slight_smile:

I needed to copy all files inside /home/node/ and executed all commands inside this directory.

I don’t know the reason, but it worked.

Thanks Brad!

Instead of copying the files to /home/node you might try the following:

steps:
  - name: test
    image: node
+   user: root
    commands:
    - npm install
    - npm run test

The Drone workspace is a Docker volume and Docker volumes are owned by root. If your image set a default non-root users this can cause access problems to the volume.

1 Like