Npm ERR! Cannot read property 'find' of undefined (React Native)

I’m trying to migrate from BuddyBuild to BitRise for a React Native application that is live (both iOS and Android) and when I try to build the Master version (which is valid and live on both iOS/Android) it gets an error on the NPM Install step.

Given that this runs on BuddyBuild as well as locally I have no idea why this is happening. Has anyone else seen this?

Run npm command

  • npm install
    npm ERR! Cannot read property ‘find’ of undefined
    npm ERR! Cannot read property ‘find’ of undefined
    npm ERR! Cannot read property ‘find’ of undefined
    npm ERR! A complete log of this run can be found in:
    npm ERR! /Users/vagrant/.npm/_logs/2017-08-27T01_01_49_556Z-debug.log
    | |
    ±–±--------------------------------------------------------------±---------+
    | x | npm (exit code: 1) | 28 sec |
    ±–±--------------------------------------------------------------±---------+
    | Issue tracker: https://github.com/bitrise-steplib/steps-npm/issues |
    | Source: https://github.com/bitrise-steplib/steps-npm |
    ±–±--------------------------------------------------------------±---------+

Hi @connortyrrell,
thanks for the report! Could you please send us your full build log file on bitrise.io on-site chat?

Did you manage to solve the issue @connortyrrell?

Yes! Great support by the BitRise crew! Fixed it by running a script before the “Run NPM Command” of:

set -ex
npm i -g npm@latest
rm -rf $HOME/.npm
npm cache verify
1 Like

Thanks for the script @connortyrrell ! :wink: