0

Is there any tip to solve the error "The serve command requires to be run in an Angular project, but a project definition could not be found." ?

PS C:\angular\pro\toitsu-view> ng serve
The serve command requires to be run in an Angular project, but a project definition could not be found.
PS C:\angular\pro\toitsu-view> npm install
npm WARN toitsu-view@1.0.0 No repository field.
npm WARN toitsu-view@1.0.0 No license field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: amdefine@1.0.1 (node_modules\amdefine):
npm WARN network SKIPPING OPTIONAL DEPENDENCY: request to https://registry.npmjs.org/amdefine failed, reason: connect ETIMEDOUT 93.184.216.34:8082
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: source-map@0.1.43 (node_modules\ast-transform\node_modules\source-map):
npm WARN network SKIPPING OPTIONAL DEPENDENCY: request to https://registry.npmjs.org/source-map failed, reason: connect ETIMEDOUT 93.184.216.34:8082

npm ERR! code ETIMEDOUT
npm ERR! errno ETIMEDOUT
npm ERR! network request to https://registry.npmjs.org/ansi-gray failed, reason: connect ETIMEDOUT 93.184.216.34:8082
npm ERR! network This is a problem related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly.  See: 'npm help config'

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\xaxanoulis\AppData\Roaming\npm-cache\_logs\2021-08-18T12_15_16_126Z-debug.log
PS C:\angular\pro\toitsu-view>
R. Richards
  • 24,603
  • 10
  • 64
  • 64

2 Answers2

0

Change the path where you run the ng serve command and try. It should run inside Angular project where you see src folder

Siva Makani
  • 196
  • 2
  • 17
0

I think you are in the wrong directory, and this isn't being registered as an angular project. You should navigate inside the directory that has the following files

  1. angular.json

This will be your application root folder. Once you navigate here run npm install and then npm start /ng serve

Something like this. I'll navigate inside primeng-testing to run these above mentioned commands.

enter image description here

amnah
  • 444
  • 2
  • 6