SAP / cloud-mta-build-tool

Multi-Target Application (MTA) build tool for Cloud Applications https://sap.github.io/cloud-mta-build-tool
Apache License 2.0
137 stars 57 forks source link

MBT with grunt (mkdir:dist) failed #857

Open RichardTezbir opened 3 years ago

RichardTezbir commented 3 years ago

Hi everybody, I'm new to project, and I'm not experienced with MBT, nor grunt. But after reasearch I see no mistake from my side, which I'm aware of.

Please provide the following info:

Steps to Reproduce:

  1. Install required packages -g ( mbt, grun, cloud foundry, make(GNUwin) )
  2. Reinstall nodejs+ npm,
  3. Create folder dist manually
  4. Set admin rights to particular folders
  5. Clone project from git to different parts of computer
  6. Try different terminal ( bash, powershell, cmd [opened as admin]

Grunt-file:

module.exports = function (grunt) {
    "use strict";
    grunt.loadNpmTasks("@sap/grunt-sapui5-bestpractice-build");
    grunt.config.merge({
        compatVersion: "edge",
        deploy_mode: "html_repo"
    });
    grunt.registerTask("default", [
        "clean",
        "lint",
        "build"
    ]);
    grunt.loadNpmTasks("@sap/grunt-sapui5-bestpractice-test");
    grunt.registerTask("unit_and_integration_tests", ["test"]);
    grunt.config.merge({
        coverage_threshold: {
            statements: 0,
            branches: 100,
            functions: 0,
            lines: 0
        }
    });
};

Problem description:

  1. Clone git repository, and with required packages installed, I run mbt build -p=cf
  2. Everything goes smooth, untill execution of grunt tasks.
  3. Clean, lint OK
  4. task mkdir:dist returns code 6 and break.

Output since grunt tasks:

[2021-04-21 08:13:37] INFO executing the "grunt" command... ....distDirC:\Users\RichardTezbir\Desktop\workPlace\Innogy-IOT\locationsoverview\LocationExtensionAIN-app\dist ..... Running "clean:dist" (clean) task

0 paths cleaned.

Running "clean:coverage" (clean) task

0 paths cleaned.

Running "lint" task

Running "mkdir:dist" (mkdir) task Creating "C:\Users\RichardTezbir\Desktop\workPlace\Innogy-IOT\locationsoverview\LocationExtensionAIN-app\dist"...ERROR Warning: Mkdir operation failed. Use --force to continue.

Aborted due to warnings. [2021-04-21 08:13:46] ERROR could not build the "LocationExtensionAIN-app" module: could not execute the "grunt" command: exit status 6 make: *** [LocationExtensionAIN-app] Error 1 Error: could not build the MTA project: could not execute the "make -f Makefile_20210421081247.mta p=cf mtar= strict=true mode=" command: exit status 2

Conclusion:

It seems there is problem with grunt rights to create folder. So I run grunt build command inside the folder with gruntfile, and everything works fine.

So I assume it is problem with mbt build, which I grant all the permissions needed through windows-folder properties in security section.

The thing is, for all my colleagues it is working just fine. Probably it is not general issue, I just see no difference between their settings and mine.

If you have any ideas what can cause problem, please refer to me with additional question, if you need more informations.

83819269 commented 3 years ago

file package.json : change dependencies "grunt": "^1.3.0" to "grunt": "^0.4.5" , then have a try again

Haegi commented 3 years ago

I am facing the same issue and I don't think that downgrading the version will help in the long term. Even as short-term mitigation downgrading the version from 1.x.x to 0.4.x doesn't look right. @83819269

harsh28799 commented 2 years ago

I am facing the same issue with exact same script. Please share if you know what is causing the issue and if some solution. @83819269

ExternalMe commented 2 years ago

I faced the same issue! This is the solution, that works for me:

  1. Open elevated cmd in Win.
  2. Uninstall grunt-cli: npm uninstall -g grunt-cli
  3. Reinstall grunt-cli with admin priviliges: npm install -g grunt-cli
divyathaore commented 2 years ago

@ExternalMe I tried the steps you mentioned. But still facing the same issue. I am also facing the same issue and the script is also the same.

Running "lint" task

Running "mkdir:dist" (mkdir) task Creating "C:\Users\I5###\S###R\JavaBackend\acrs-core-mtar\acrscore-html5\dist"...ERROR Warning: Mkdir operation failed. Use --force to continue.

Aborted due to warnings. [2022-04-26 23:42:58] ERROR could not build the "acrscore-html5" module: could not execute the "grunt" command: exit status 6

sudhirlenkagit commented 2 years ago

Hello Team,

We are having the same issue. Is there any solution ?

-Sudhir.