Yarn not respecting .npmrc for private npm registries

I’m using EAS to build an app but am having difficulties getting a private NPM Registry (FontAwesome) to play ball:

[stderr] error An unexpected error occurred: "https://npm.fontawesome.com/@fortawesome/fontawesome-common-types/-/0.2.34/fontawesome-common-types-0.2.34.tgz: Request failed \"401 Unauthorized\"".

I have an .npmrc file with the auth token provided which enables the packages to be pulled locally, but it almost feels like yarn on the EAS build servers isn’t respecting this and so cannot access the private registry.

Is this a known issue? Is there an alternate recommended approach for private npm registries?


Expo diagnostics:

 Expo CLI 4.0.17 environment info:
    System:
      OS: macOS 11.1
      Shell: 5.8 - /bin/zsh
    Binaries:
      Node: 10.16.3 - ~/.nvm/versions/node/v10.16.3/bin/node
      Yarn: 1.22.10 - /usr/local/bin/yarn
      npm: 6.14.11 - ~/.nvm/versions/node/v10.16.3/bin/npm
    SDKs:
      iOS SDK:
        Platforms: iOS 14.3, DriverKit 20.2, macOS 11.1, tvOS 14.3, watchOS 7.2
    IDEs:
      Xcode: 12.3/12C33 - /usr/bin/xcodebuild
    npmPackages:
      expo: ^40.0.0 => 40.0.0
      react: 16.13.1 => 16.13.1
      react-dom: 16.13.1 => 16.13.1
      react-native: https://github.com/expo/react-native/archive/sdk-40.0.1.tar.gz => 0.63.2
      react-native-web: ~0.13.12 => 0.13.18
    npmGlobalPackages:
      expo-cli: 4.0.17
    Expo Workflow: managed

hi there,

you need to set your npm token as described here: Integrating with JavaScript tooling - Expo Documentation

edit: sorry i may have misread the issue. it seems that this particular option will not help your use case.

is your .npmrc in your project directory and committed to your git repo?

It is, yes

Ah I think this was down to git-crypt; I tried removing .npmrc from git-crypt and EAS seems to be building without issue now! Sorted :+1:

1 Like

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.