:wave: Hello, team! I defined “<@U016YT3BNTU>/pact...
# pact-js
y
👋 Hello, team! I defined “@pact_foundation_greet/pact”: “9.18.1", on my package json, install it, wrote some tests, run and all is great. I am using mac. in my CI, the npm install (also for the pact) happens inside docker (node:16.16.0-bullseye-slim), In the installation I am getting the following error npm ERR! code 1 npm ERR! path /usr/src/app/node_modules/@pact-foundation/pact-node npm ERR! command failed npm ERR! command sh -c node postinstall.js npm ERR! Installing Pact Standalone Binary for linux. npm ERR! Downloading Pact Standalone Binary v1.89.02-rc1 for platform linux from https://github.com/pact-foundation/pact-ruby-standalone/releases/download/v1.89.02-rc1/pact-1.89.02-rc1-linux-x86_64.tar.gz npm ERR! Please note: we are tracking this download anonymously to gather important usage statistics. To disable tracking, set ‘pact_do_not_track: true’ in your package.json ‘config’ section. npm ERR! Error: Error while installing binary: Postinstalled Failed Unexpectedly: Error downloading binary from https://github.com/pact-foundation/pact-ruby-standalone/releases/download/v1.89.02-rc1/pact-1.89.02-rc1-linux-x86_64.tar.gz: Error: Error while installing binary: Error: EACCES: permission denied, open ‘/root/.npmrc’ npm ERR! at throwError (/usr/src/app/node_modules/@pact-foundation/pact-node/standalone/install.js4211) npm ERR! at /usr/src/app/node_modules/@pact-foundation/pact-node/standalone/install.js32716
m
my guess is proxies. Albeit, not sure why it’s looking at
.npmrc
y
there isn’t anyproxy that I know about, I can reproduce it frrom my computer as well
👍 1
on my computer it works well, but when I run it inside the container, the issue happens (like our CI)
it was weird to me as well why should it looks
m
Can you please share a repro container definition so we can investigate?
y
After investgation, i found the root cause of the issue. In my env, i have a node project that Installed over a container. in the docker file, was define the home project in the root folder (maybe a mistake) on the root folder (/root), and the project on the project folder (src/app). when doing npm install inside the container, the pact trying to read the user npmrc, that exist by default on the home folder, and it get an access denied. in my side, the workaround for this, is to change the root folder (home) permission, or to change the home directory. but maybe it should be considered as a bug (corner case) and to try to strat read over the huracrchey, and if get an excaption got to the parent (project, uuser, global), in this case, because the home hasn’t permission, it breaks the installation.
🙌 1
m
Nice digging Yair! If you could please raise an issue we'll get it looked at, I know why we load that file and I think we can improve the error handling if not found
y
thanks for your answer. pls send me a link and I will open
👍 1
m