Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Bamboo with NPM, Webpack and Babel. Windows permissions ?

luis santos
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 1, 2018

Hello guys, we are evaluating Bamboo CI to build our front end projects. We use Javascript, NPM, Webpack, ReactJS and Babel technology stack. When I create a build plan my repo gets checked out but the build fails since Babel doesn't seem to be compiling the files properly.

Weird thing is that this just happens in the build-dir directory. If I copy and paste the same project outside bamboo-home the whole build goes fine. 

At this point I am trying to build my project straight from the console and I see the same results. Is there any configuration or maybe permissions that I am missing here ?

 

Thanks in advance

Luis

1 answer

0 votes
Jeyanthan I
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 1, 2018

Hi Luis,

What does the bamboo build log complain? 

Weird thing is that this just happens in the build-dir directory.

I assume you are not able to compile your project within the build directory, but the compilation is successful when run outside. Am I right? 

This to me looks like a permission issue. Check if the bamboo user has appropriate permission to build in that directory.

We can tell you more with the build log snip.

luis santos
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 1, 2018

it is not building/compiling from cmd either but just if I am inside build-dir. Like I said if I copy and paste the same project outside bamboo-home it builds as expected.

 

ERROR in ./index.js
Module parse failed: C:\opt\bamboo-home\xml-data\build-dir\STA-DEV-JOB1\node_modules\babel-loader\lib\index.js!C:\opt\bamboo-home\xml-data\build-dir\STA-DEV-JOB1\src\index.js Unexpected token (24:8)
You may need an appropriate loader to handle this file type.
| const render = (Component, target) => {
| ReactDOM.render(
| <Provider store={store}>
| <AppContainer>
| <Component/>
@ multi babel-polyfill react-hot-loader/patch ./index.js

 

It seems to me that it may be a permission issue as well but maybe with the OS (Windows in this case) or maybe a different environment is being used inside bamboo-home ...

Jeyanthan I
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 2, 2018

This looks like some environment variables are not available for the user running Bamboo. Let's test that by creating a test plan and run the below commands in a shell task choosing Powershell as the interpreter.

echo "Full Path"
[Environment]::GetEnvironmentVariable("Path")
echo "System Path"
[Environment]::GetEnvironmentVariable("Path", "Machine")
echo "User Path"
[Environment]::GetEnvironmentVariable("Path", "User")
SET

This will just list the contents of each PATH variable and the list of environment variables available for that user.

You can then compare the result by running the same outside Bamboo and spot the difference and define new ones accordingly.

Hope that helps.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events