1

Problem

When I run ng build to generate dist folder in project, it show No projects support the 'build' target. Capture error

Project Environment

angular: 2  
angular-cli: 1.0.0-beta.18  
node: 6.0.0

Local Environment

Angular CLI: 13.0.1
Node: 16.13.0
Package Manager: npm 8.1.0
OS: win32 x64

Angular: 2.4.9

Package.json

{
  "name": "EDelivery",
  "version": "2.7.0",
  "license": "Wrapbootstrap",
  "angular-cli": {},
  "scripts": {
    "start": "ng serve",
    "build": "ng build && nodemon server.js",
    "lint": "tslint \"public/**/*.ts\"",
    "test": "ng test",
    "pree2e": "webdriver-manager update",
    "e2e": "protractor"
  },
  "private": true,
  "dependencies": {
    "@angular/common": "~2.4.1",
    "@angular/compiler": "~2.4.1",
    "@angular/core": "^2.4.1",
    "@angular/forms": "~2.4.1",
    "@angular/http": "~2.4.1",
    "@angular/platform-browser": "~2.4.1",
    "@angular/platform-browser-dynamic": "~2.4.1",
    "@angular/router": "~3.1.0",
    "@ngui/sortable": "^0.4.1",
    "@types/moment": "^2.13.0",
    "@types/moment-timezone": "^0.5.3",
    "angular-calendar": "^0.25.2",
    "angular2-auth": "^0.1.7",
    "angular2-google-maps": "^0.17.0",
    "angular2-ladda": "^1.1.1",
    "angular2-moment": "^1.7.1",
    "angular2-select": "^1.0.0-beta.2",
    "angular2-tag-input": "^1.2.3",
    "angular2-ui-switch": "^1.2.0",
    "angular2-useful-swiper": "^4.0.5",
    "angular2-uuid": "^1.1.1",
    "animate.css": "3.1.1",
    "ap-angular2-fullcalendar": "^1.6.4",
    "apn": "^2.2.0",
    "async": "^2.1.2",
    "body-parser": "^1.15.2",
    "bootstrap": "^3.3.7",
    "chart.js": "^2.7.1",
    "cluster": "^0.7.7",
    "compress-images": "^1.1.8",
    "compression": "^1.6.2",
    "connect-redis": "^3.1.0",
    "cookie-parser": "^1.4.3",
    "core-js": "^2.4.1",
    "countries-and-timezones": "^1.0.0",
    "country-data": "0.0.31",
    "currency-symbol-map": "^3.1.0",
    "express": "^4.10.7",
    "express-session": "^1.14.2",
    "font-awesome": "^4.7.0",
    "geolib": "^2.0.24",
    "jquery": "^3.1.0",
    "jsontocsv": "^0.3.0",
    "jspdf": "^1.3.5",
    "le-challenge-fs": "^2.0.8",
    "le-store-certbot": "^2.0.3",
    "letsencrypt-express": "^2.0.5",
    "logger": "0.0.1",
    "metismenu": "^2.5.0",
    "moment": "^2.20.1",
    "moment-timezone": "^0.5.14",
    "mongodb-backup": "^1.6.9",
    "mongodb-restore": "^1.6.2",
    "mongoose": "^4.13.17",
    "mongoose-auto-increment": "^5.0.1",
    "mongoose-pages": "0.0.3",
    "mongoose-paginate": "^5.0.3",
    "multer": "^1.2.0",
    "mydatepicker": "^1.7.4",
    "ng2-bs3-modal": "^0.10.4",
    "ng2-charts": "^1.6.0",
    "ng2-dropdown": "0.0.21",
    "ng2-google-place-autocomplete": "^1.4.2",
    "ng2-img-cropper": "^0.9.0",
    "ng2-notifications": "^0.3.0",
    "ng2-overlay": "^0.7.0",
    "ng2-owl-carousel": "^0.1.15",
    "ng2-password-strength-bar": "^1.0.1",
    "ng2-popup": "^0.4.0",
    "ng2-select": "^1.2.0",
    "ng2-tag-input": "^0.8.5",
    "ng2-toastr": "^1.6.0",
    "ng2-translate": "^5.0.0",
    "ng2-twitter": "^0.3.0",
    "ng2-ui-sortable": "^0.3.0",
    "ng2-validation": "^4.2.0",
    "ngx-facebook": "^2.4.0",
    "ngx-rating": "0.0.9",
    "ngx-tooltip": "0.0.9",
    "node-cache": "^4.1.0",
    "node-currency-swap": "^1.0.6",
    "node-gcm": "^0.14.4",
    "node-schedule": "^1.2.0",
    "nodemailer": "^2.6.4",
    "nodemon": "^1.11.0",
    "owl.carousel": "^2.2.0",
    "pad-left": "^2.1.0",
    "randomstring": "^1.1.5",
    "redis": "^2.6.3",
    "rxjs": "5.0.0-beta.12",
    "stripe": "^4.14.0",
    "sweetalert2": "^6.3.8",
    "textversionjs": "^1.0.2",
    "togeojson": "^0.16.0",
    "ts-helpers": "^1.1.1",
    "twilio": "^2.11.1",
    "typescript": "^2.0.10",
    "typescript-require": "^0.2.9-1",
    "xmldom": "^0.1.27",
    "zone.js": "^0.6.23"
  },
  "devDependencies": {
    "@types/googlemaps": "^3.26.2",
    "@types/jasmine": "^2.2.30",
    "@types/node": "^6.0.42",
    "angular-cli": "1.0.0-beta.18",
    "codelyzer": "1.0.0-beta.1",
    "jasmine-core": "2.4.1",
    "jasmine-spec-reporter": "2.5.0",
    "karma": "1.2.0",
    "karma-chrome-launcher": "^2.0.0",
    "karma-cli": "^1.0.1",
    "karma-jasmine": "^1.0.2",
    "karma-remap-istanbul": "^0.2.1",
    "protractor": "4.0.9",
    "sw-precache": "^5.2.1",
    "ts-node": "1.2.1",
    "tslint": "3.13.0",
    "typescript": "~2.0.3"
  }
}

Angular-cli.json

{
    "project": {
        "version": "2.7.0",
        "name": "EDelivery"
    },
    "apps": [
        {
            "root": "public",
            "outDir": "dist",
            "assets": [
                "assets",
                "favicon.ico"
            ],
            "index": "index.html",
            "main": "main.ts",
            "test": "test.ts",
            "tsconfig": "tsconfig.json",
            "prefix": "app",
            "mobile": false,
            "styles": [
                "assets/styles/bootstrap.css",
                "../node_modules/font-awesome/css/font-awesome.css",
                "../node_modules/sweetalert2/dist/sweetalert2.css",
                "assets/styles/styles.css",
                "assets/styles/newstyle.css",
                "assets/styles/chosen/bootstrap-chosen.css",
                "assets/styles/iCheck/custom.css",
                "assets/styles/animate.css",
                "../node_modules/owl.carousel/dist/assets/owl.carousel.css",
                "../node_modules/owl.carousel/dist/assets/owl.theme.default.css",

                "assets/styles/c3.css",
                "assets/styles/clockpicker/clockpicker.css",
                "assets/styles/steps/jquery.steps.css",
                "assets/styles/jasny/jasny-bootstrap.min.css",
                "../node_modules/ng2-toastr/bundles/ng2-toastr.min.css",
                "../node_modules/ladda/dist/ladda.min.css"
            ],
            "scripts": [
                "../node_modules/jquery/dist/jquery.js",
                "../node_modules/metismenu/dist/metisMenu.js",
                "../node_modules/sweetalert2/dist/sweetalert2.js",
                "../public/vendor/pace/pace.min.js",
                "../node_modules/bootstrap/dist/js/bootstrap.js",
                "assets/js/d3.js",
                "assets/js/c3.js",
                "assets/js/hammer.js",
                "assets/js/chosen/chosen.jquery.js",
                "assets/js/iCheck/icheck.min.js",
                "assets/js/clockpicker/clockpicker.js",
                "assets/js/jasny/jasny-bootstrap.min.js",
                "assets/js/touchspin/jquery.bootstrap-touchspin.min.js"
            ],
            "environments": {
                "source": "environments/environment.ts",
                "dev": "environments/environment.ts",
                "prod": "environments/environment.prod.ts"
            }
        }
    ],
    "addons": [],
    "packages": [],
    "e2e": {
        "protractor": {
            "config": "./protractor.conf.js"
        }
    },
    "test": {
        "karma": {
            "config": "./karma.conf.js"
        }
    },
    "defaults": {
        "styleExt": "css",
        "prefixInterfaces": false,
        "inline": {
            "style": false,
            "template": false
        },
        "spec": {
            "class": false,
            "component": true,
            "directive": true,
            "module": false,
            "pipe": true,
            "service": true
        }
    }
}

What I tried

I have tried downgrade angular, angular-cli and node version to the same with project environment but it still show the error

Thank you!

R. Richards
  • 24,603
  • 10
  • 64
  • 64
Loc Nguyen
  • 19
  • 1
  • Is there a specific reason why you want to use such an old Angular version..? – MikeOne Nov 07 '21 at 16:00
  • @MikeOne yes, because it is the old project in my company The weird thing is it build perfect on my partner's laptop, I just pull the code and didn't change anything – Loc Nguyen Nov 07 '21 at 16:10
  • I wonder if it’s actually using the correct (old) cli.. – MikeOne Nov 07 '21 at 16:23
  • @MikeOne based on the note, it use angular-cli ver 1.0.0-beta18, I can't find this version so I have tried install angular-cli version 1.0.0 but it still not work – Loc Nguyen Nov 07 '21 at 16:38
  • If you’re inside the project root folder and you run ng —version what does it show? – MikeOne Nov 07 '21 at 16:45
  • @MikeOne it show the same with local environment I have posted. Angular CLI: 13.0.1 Node: 16.13.0 Package Manager: npm 8.1.0 OS: win32 x64 Angular: 2.4.9 – Loc Nguyen Nov 07 '21 at 16:50
  • So.. there is your issue right? It takes your globally installed (way too new) cli. You can try to run the old angular-cli by calling it directly from your projects node_modules folder – MikeOne Nov 07 '21 at 16:53

0 Answers0