The bamboo construction falters as webpack is unable to locate the node_modules

After setting up my Angular project with webpack in version 1.7, everything runs smoothly locally when I execute the npm run build task to launch webpack.

However, I encountered an issue when trying to set up a plan for continuous integration using bamboo. When running the NPM task with npm run build, I received an error message:

Error: Cannot find module './yargs'

I suspect that webpack may not be able to access the node_modules directory or is looking in the wrong location.

Despite having installed node_modules and confirming yargs exists after performing the npm install task beforehand, I still encountered this issue.

If I include a script before running npm run build with the "ls -l" command, it shows:

node_modules
package-lock.json
package.json
src
webpack.config.js

So, the necessary folder is indeed present.

Any suggestions on where else I should investigate?

Answer №1

Successfully resolved the problem by ensuring the "Force clean build" option was enabled in the Source code checkout configuration. The build completed successfully as a result.

It appears there may have been an issue with conflicting node_modules from a previous build, although the exact cause is unclear.

Answer №2

It's important to note that the file name you mention is case-sensitive during the bamboo build process.

If you are building locally, there won't be any errors or warnings in the console.

I came across this issue with a local file (not a node_module)... Hopefully, this information will benefit someone down the line;

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Differences between npm package versions in local development and production environments

I am currently working on a project where I have created my own package called "database." The challenge I am facing is that as I develop the database alongside the project itself, I find it inconvenient to continuously push and pull versions of the databa ...

Why am I encountering a 404 error when trying to install @microsoft/microsoft-graph-client using npm install?

npm install @company/company-graph-client --save npm ERR! code E404 npm ERR! 404 Not Found: @company/company-graph-client@^1.0.0 Running Node v8.9.0 and npm v5.1.0. ...

Unable to locate 'URL' in the redux-auth-wrapper

Upon attempting to activate my ReactJS project using the npm start command, I encountered the following error message: ERROR in ./node_modules/redux-auth-wrapper/history4/locationHelper.js 17:11-25 Module not found: Error: Can't resolve 'url ...

Is there a way to retrieve a raw value from the API response that matches the one shown in POSTMAN, but my attempts have been unsuccessful?

Looking for some assistance with fetching data from a front-end (React) to the raw value in JSON. Specifically, I'm having trouble with the login functionality. When I input my email and password, the response should match what I see in POSTMAN, but i ...

Error message in Linux for NodeJS global NPM package: "File or directory does not exist"

After setting up my Ubuntu 14.04 system, I installed nodejs and npm using the command: sudo apt-get install nodejs npm To ensure packages utilize the node interpreter instead of nodejs, I created a symlink with: sudo ln -s /usr/bin/nodejs /usr/local/bin ...

Having trouble installing the `<module>` package with npm due to a persistent error, possibly related to the node-gyp build process

My attempt to install jsdom looks like this: $ sudo npm install -g jsdom # OR $ sudo npm install jsdom Despite some successful commands, the installation quickly fails, with the first error message appearing after the [....]: $ sudo npm install jsdom ...

How can I incorporate HAML and SASS into a non-Ruby project with ease?

I am exploring the use of haml with sass to create templates without relying on rails. One challenge I am facing is including haml partials properly. Here is the current structure of my project: build source -- scss -- js -- views --- pages ---- home.ha ...

Issue encountered when attempting to create a new React application ("The version of `create-react-app` you are using is 4.0.3, which is not up to date with the latest release (5.0.0

Despite uninstalling the create React app, I am still encountering the same error repeatedly. npm uninstall -g create-react-app The package is up to date, audited in 570ms No vulnerabilities were found npx create-react-app test-app You need to install t ...

I was having trouble getting my npm to run properly during initialization. I'm hoping this is not the main issue. Could someone please review my work? It doesn't seem to be rendering as expected

From the start of my certification, I've been struggling with npm and json not working. Two peer reviews of my app had conflicting feedback - one said all features were there while another claimed it was completely unusable. I'm trying to iron ou ...

Every time I attempt to execute an npm command, I encounter the error message "spawn bash ENOENT."

I'm encountering an error Attempting to execute any npm command results in the spawn bash ENOENT error, preventing me from moving forward. Can someone offer assistance please? ...

Encountering an ECONNREFUSED error in the terminal while attempting to install the Express package

https://i.stack.imgur.com/t3E4i.png When executing the following command npm install express ...

Tips for integrating frontend npm packages into your project

As a beginner in Node.js web development, I recently used ExpressGenerator to create a project with the ExpressJS framework. I'm now looking to integrate the FineUploader front-end JS library into my application, which is available as an NPM package. ...

What is the purpose of creating a package-lock.json file when npm already has the npm-shrinkwrap.json for locking dependencies?

npm-shrinkwrap.json: Securing the node_modules tree and its dependencies and sub-dependencies to ensure the package remains stable across different machines. package-lock.json: Safeguarding the node_modules tree along with its dependencies and nested depe ...

Is it possible to update the version without requiring specific commits for version changes?

When using tags with GitHub, commits may not be necessary as the version number is independent from them. However, when publishing to npm, it becomes crucial to update the package.json file, resulting in numerous 'Bump version' commits which can ...

Encountering an npm error: How can I install compiler-sfc that satisfies the peer dependency requirement for @babel/core?

Review of my packageJSON "devDependencies": { "@fortawesome/fontawesome-svg-core": "^1.2.35", "@fortawesome/free-solid-svg-icons": "^5.15.3", "@vue/compiler-sfc": "^3. ...

Encountering an issue while setting up a Next.js project, I am struggling to find a solution despite trying various methods

I attempted to install Next.js, and even updated my npm version in order to create a new React project with the latest Next.js. However, I kept encountering the same error. Aborting installation. Unexpected error. Please report it as a bug: Error: spawn ...

When running my code on my local machine (MAC OSX), I encountered an issue where the "htmlextra" reporter was not found for generating the HTML report

Upon running the newman run command with the parameter -r htmlextra, I encountered the following message. Even though I had already installed htmlextra globally using -g, I am able to execute it when creating a newman .js file. Can you provide advice on wh ...

error encountered while trying to install angular cli on mac

Having successfully installed npm and node on my system, I am currently facing an issue with installing Angular-cli. The command line I am using is as follows: npm install -g @angular/cli@latest Unfortunately, this command is resulting in a permission er ...

Struggling with slow response times when interacting with Firestore in Firebase Cloud Functions?

I am currently experiencing performance issues with a simple Cloud Function in Firebase. This function is responsible for taking JSON data through an HTTP POST request and storing it in a Firestore collection. Despite being assigned 512MB of memory, the pe ...

Set a custom directory as the new path for installing global packages with npm

Looking to customize my node setup on Windows so that it saves global modules (installed with npm install -g <pkg>) in a specific directory, D:\node_modules, instead of the default path at C:\Users\User\AppData\Roaming\n ...