Anonymous registries will be directly queried. Registries that require authentication and authorisaion will read ~/.docker/config.json for your credentials. See Docker Registry v2 authentication via central service for more details. If credentials cannot be found, you will be prompted to create them. Install Bitbucket Server as a service On Linux and Windows systems, the installer can install Bitbucket Server as a service (although not when upgrading an existing instance of Bitbucket Server). A service account named 'atlbitbucket' will be created.
- Npm Install Git Ssh
- Npm Install From Github
- Install Npm Package From Github
- Npm Install From Zip
- Install Npm Module From Bitbucket
Active1 year, 2 months ago
Question
What is wrong with my
Dockerfile
or bitbucket-pipelines.yml
? Why are modules missing from the bitbucket pipelines environment?Error
When I try to
npm run build
my Vue2 project with webpack using Bitbucket Pipelines, I get errors regarding missing modules.Npm Install Git Ssh
From Logs
Files
Pirates of the burning sea download. Here are the files for configuration.
Dockerfile - builds cportwine/people-is
bitbucket-pipelines.yml
package.json
What I see
When I
ls
the node_modules
folder in both environments, they do not match. Modules are missing from bitbucket pipelines.local folder
people-is/node_modules
bitbucket folder
/opt/atlassian/pipelines/agent/build/node_modules
Woah, missing modules!
What I have tried
I added a command to the
bitbucket-pipelines.yml
to npm install
before I build.bitbucket-pipelines.yml
This adds some additional modules (like
cli-spinners
from the error) to /opt/atlassian/pipelines/agent/build/node_modules
.bitbucket folder
/opt/atlassian/pipelines/agent/build/node_modules
Npm Install From Github
However, the build command still fails, due to a different missing module.
Error
Chadd
ChaddChadd
2 Answers
Solutions
I can now build the app, but I don't know why!
1 - Simplify the Dockerfile
I removed all the npm commands. Maybe the
npm install
commands were redundant? There was no advantage using the Docker Image to pre-install npm packages. 2 - Remove Node_Modules before install
Using the
bitbucket-pipelines.yml
, remove the node_modules
folder, and then perform npm install -g npm
and npm install
and npm install -g firebase-tools
.File Changes
bitbucket-pipelines.yml (added lines)
Dockerfile (lines removed)
Answer ?
I'm not sure why moving all the
npm install
stuff into the bitbucket.pipelines.yml
solved my issue building the project. I thought Docker would enable me to define my environment, e.g., install a version of node/npm and firebase. And pipelines would 'run' that.If someone could explain what I am missing, I would accept that answer.
ChaddChadd
Install Npm Package From Github
Answer
I received support from the Atlassian Team
Npm Install From Zip
- Leave
npm install -g firebase
in the docker image. - Move
npm install
from the docker image to thebitbucket-pipelines.yml file.
Reason
The
node_modules
folder was listed in .gitignore
tl;dr
My mistake - I forgot about
.gitignore
and how that affects the node_modules
folder in source control, e.g., Bitbucket Pipelines.I was looking at my local
node_modules
folder and building locally which worked.However
Install Npm Module From Bitbucket
The
node_modules
in source control, by design, is not in-sync with my local folder because it's included in the .gitignore
file.So
It was necessary for me to
rm node_modules
and npm install
using the bitbucket-pipelines.yml. Now, BitPipes finds the modules I have installed locally.This is sort of the point of maintaining the
package.json
, but I got confused.ChaddChadd