I use a npm package called 'cypress-file-upload' and import it in the index.js file within cypress/support.
In the bitbucket-pipelines.yml file, I use npm install cypress-file-upload command in the scripts in order to install that package.
Not sure why I still see the module not found error in the pipeline.