0

For my angular CLI/Bitbucket project I am running following script in Codeship but it gives error You have to be inside an angular-cli project in order to use the serve command.

#install node version, 4.x is required for the angular-cli
nvm install 4.1

#install angular-cli
npm install angular-cli 

#run npm install for your project dependencies
npm install

Under that script is the "Test Pipelines", where the script is setup to run the tests.

#serve the application adding '&' to run command in background
ng serve &

#start end to end tests using protractor
ng test

#if all of the tests pass, then build the production assets
ng build -prod  
Manu Chadha
  • 15,555
  • 19
  • 91
  • 184
  • Ahoy :) Judging from the error message it seems like the `ng` CLI doesn't recognize the project as an Angular project. Out of curiosity, did you already create a ticket on https://helpdesk.codeship.com and if not, could you create one and include a link to the failing builds? We'd be happy to take a look and help you solve this. – mlocher Sep 04 '17 at 20:25
  • I have raised this ticket. I am told to run SSH debug but I am finding it difficult to follow the steps. Even after I have added the ssh key, the console asks for `password` which I suppose it shouldn't - Ticket is https://helpdesk.codeship.com/hc/en-us/requests/15489 – Manu Chadha Sep 04 '17 at 20:28
  • Alright, let me take a look at that ticket and get back to you there. – mlocher Sep 05 '17 at 06:14

1 Answers1

0

According to https://github.com/angular/angular-cli/issues/4379 this error message is usually triggered if you're using the (now deprecated) angular-cli package.

Either update the package.json file for the project to reference the @angular/cli package, or make sure to install this package instead of the deprecated one.

mlocher
  • 766
  • 5
  • 11
  • Sorry, can't help you with Shippable, especially without any log files. Did you try my suggestion on Codeship and see if it worked (or failed with a different error message that is caused by a different error)? – mlocher Sep 05 '17 at 12:33
  • My apologies, I got confused. I shouldn't have mixed them up. I'll try to delete my comment and try your suggestion. – Manu Chadha Sep 05 '17 at 13:37
  • didn't work :(. New configuration is `#install node version, 4.x is required for the angular-cli nvm install 6 #install angular-cli #npm install angular-cli #run npm install for your project dependencies npm install` – Manu Chadha Sep 05 '17 at 13:42
  • some progress. Instead of commenting angular/cli, I added `npm install @angular/cli@latest`. I do not get `ng serve` error but am stuck in production now. Will work on it. However, I don't understand why @angular/cli didn't get installed from `package.json` – Manu Chadha Sep 05 '17 at 13:47
  • production error is `ERROR in ./src/main.ts Module not found: Error: Can't resolve './$$_gendir/app/app.module.ngfactory' in '/home/rof/src/bitbucket.org/ManuChadha/angularcli/src' @ ./src/main.ts 4:0-74 @ multi ./src/main.ts` – Manu Chadha Sep 05 '17 at 13:49
  • I am accepting your answer as the main issue is resolved. thank you. – Manu Chadha Sep 05 '17 at 14:07