I am using three.js in angular application.
ng build works fine locally but bitbucket pipeline fails with falling error.
Error Message: -
[ERROR] Could not resolve "three"
> ng build
❯ Building...
✔ Building...
Application bundle generation failed. [23.340 seconds]
✘ [ERROR] Could not resolve "three"
Hi @Abbas_ Ajmal _AU_ and welcome to the community!
Does the npm install command run in a different step than the ng build command? If so, this may be the reason for the error.
In builds running on Atlassian's infrastructure or with a self-hosted Linux Docker runner, for every step of the build a Docker container starts, the repo is cloned (unless you have disabled cloning), and then the commands of that step's script are executed. When the step finishes, this container gets destroyed.
Anything you install during a step won't be available to other steps, because each step runs in a separate Docker container.
If your build generates artifacts like binaries or reports that you want to make available to next steps, you can use artifacts.
If we're talking about dependencies though, I suggest installing them during the step that needs them. Having two separate steps would be similar to spinning up a virtual machine, installing dependencies, and then destroying this VM, and spinning up a new one to run your build.
Please feel free to let me know how it goes and if you have any questions!
Kind regards,
Theodora
Combining that it to single step solved the issue. Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That's good to hear, thank you for the update.
Please feel free to reach out if you ever need anything else!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.