Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't install pact module when user npmrc exist on a folder without enough permission #384

Open
shkedi opened this issue Aug 3, 2022 · 2 comments

Comments

@shkedi
Copy link

shkedi commented Aug 3, 2022

Use case:
As part of my CI installation, I installed pact inside docker, I got an error in the npm install

Investgation:
In my env, i have a node project that is Installed over a container. in the docker file, define the home project in the root folder (maybe a mistake) on the root folder (/root), and the project in the project folder (src/app). when doing npm install inside the container, the pact trying to read the user npmrc, that exists by default on the home folder, and it gets access denied.
On my side, the workaround for this is to change the root folder (home) permission or to change the home directory.

@mefellows
Copy link
Member

I think probably this line needs to be guarded against:

const config = require('libnpmconfig');
, or perhaps where it is used (e.g. https://github.com/pact-foundation/pact-js-core/blob/pact-node/standalone/install.ts#L154). If the .npmrc file cannot be found, we should just stick with the default behaviour.

@YOU54F
Copy link
Member

YOU54F commented May 2, 2023

This module is not used anymore. npm config is parsed by npm itself and by @npmcli/config

I think we can remove that dependency completely, it's deprecated

https://www.npmjs.com/package/libnpmconfig

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants