Skip to content

Commit d3787b4

Browse files
committed
Turn on NPM's unsafe-perm setting
Since CodeBuild executes all commands as root, it makes things easier and less surprising to users if unsafe-perm is enabled in ~/.npmrc, as otherwise npm may have surprising behavior, in particular around running `npm pack` and similar commands, which will emit a warning that scripts will not be run if unsafe-perm is not set, and proceed to return as if everything was successfully done.
1 parent 3b2170e commit d3787b4

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

ubuntu/nodejs/10.1.0/Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,4 +122,6 @@ RUN set -ex \
122122
&& ln -s /usr/local/bin/node /usr/local/bin/nodejs \
123123
&& rm -fr /var/lib/apt/lists/* /tmp/* /var/tmp/*
124124

125+
RUN npm set unsafe-perm true
126+
125127
CMD [ "node" ]

ubuntu/nodejs/6.3.1/Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,4 +122,6 @@ RUN set -ex \
122122
&& ln -s /usr/local/bin/node /usr/local/bin/nodejs \
123123
&& rm -fr /var/lib/apt/lists/* /tmp/* /var/tmp/*
124124

125+
RUN npm set unsafe-perm true
126+
125127
CMD [ "node" ]

ubuntu/nodejs/8.11.0/Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,4 +122,6 @@ RUN set -ex \
122122
&& ln -s /usr/local/bin/node /usr/local/bin/nodejs \
123123
&& rm -fr /var/lib/apt/lists/* /tmp/* /var/tmp/*
124124

125+
RUN npm set unsafe-perm true
126+
125127
CMD [ "node" ]

0 commit comments

Comments
 (0)