cancel
Showing results for 
Search instead for 
Did you mean: 

Facing error while building and watching CAP project.

AvaneeshPEOL
Explorer
963

I am getting the following error while executing an mta.yaml build or while executing "cds watch" command.

I am not entirely sure what is to be done for this.

user: xsuaa-user-test $ cds watch --profile hybrid
node:events:496
      throw er; // Unhandled 'error' event
      ^

Error: ENOENT: no such file or directory, stat '/home/user/projects/xsuaa-user-test/gen/srv/node_modules/@types/sap__cds'
    at statSync (node:fs:1659:25)
    at #watchFile (node:internal/fs/recursive_watch:152:28)
    at #watchFolder (node:internal/fs/recursive_watch:129:26)
    at #watchFolder (node:internal/fs/recursive_watch:131:30)
    at #watchFolder (node:internal/fs/recursive_watch:131:30)
    at #watchFolder (node:internal/fs/recursive_watch:131:30)
    at #watchFolder (node:internal/fs/recursive_watch:131:30)
    at [kFSWatchStart] (node:internal/fs/recursive_watch:200:26)
    at Object.watch (node:fs:2461:36)
    at tryWatch (/managed-content/globals/pnpm/5/.pnpm/node-watch@0.7.4/node_modules/node-watch/lib/watch.js:131:15)
Emitted 'error' event on Watcher instance at:
    at /managed-content/globals/pnpm/5/.pnpm/node-watch@0.7.4/node_modules/node-watch/lib/watch.js:134:15
    at process.processTicksAndRejections (node:internal/process/task_queues:77:11) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'stat',
  path: '/home/user/projects/xsuaa-user-test/gen/srv/node_modules/@types/sap__cds',
  filename: '/home/user/projects/xsuaa-user-test'
}

Node.js v20.12.0

 

Saritha_K
Contributor
0 Kudos

Hi Experts,

We are also facing the same error since few hours now. It was working fine 5 hours before.

Regards,

Saritha

hh
Explorer
0 Kudos
Hi together,
hh
Explorer
0 Kudos
Hi together, we have also the same problem... 😞
AvaneeshPEOL
Explorer
0 Kudos

It's been updated now, it works.

Please note the following.

I deleted the gen and node_modules folders, and then executed 'npm update' command, after which i could build and deploy the project.

View Entire Topic
hh
Explorer
0 Kudos

for me it is working now again. maybe it the library is fixed again 🙂.

I just had to execute npm install again.


Saritha_K
Contributor
0 Kudos

Hello,

 

unfortunately for us this still gives the error on terminal prompt if we execute cds watch.

cds watch output is as below-


node:events:496
throw er; // Unhandled 'error' event
^

Error: ENOENT: no such file or directory, stat '/home/user/projects/zdecisionpkg/node_modules/@types/sap__cds'
at statSync (node:fs:1659:25)
at #watchFile (node:internal/fs/recursive_watch:152:28)
at #watchFolder (node:internal/fs/recursive_watch:129:26)
at #watchFolder (node:internal/fs/recursive_watch:131:30)
at #watchFolder (node:internal/fs/recursive_watch:131:30)
at [kFSWatchStart] (node:internal/fs/recursive_watch:200:26)
at Object.watch (node:fs:2461:36)
at tryWatch (/managed-content/globals/pnpm/5/.pnpm/node-watch@0.7.4/node_modules/node-watch/lib/watch.js:131:15)
at /managed-content/globals/pnpm/5/.pnpm/node-watch@0.7.4/node_modules/node-watch/lib/watch.js:412:19
at /managed-content/globals/pnpm/5/.pnpm/node-watch@0.7.4/node_modules/node-watch/lib/has-native-recursive.js:110:9
Emitted 'error' event on Watcher instance at:
at /managed-content/globals/pnpm/5/.pnpm/node-watch@0.7.4/node_modules/node-watch/lib/watch.js:134:15
at process.processTicksAndRejections (node:internal/process/task_queues:77:11) {
errno: -2,
code: 'ENOENT',
syscall: 'stat',
path: '/home/user/projects/zdecisionpkg/node_modules/@types/sap__cds',
filename: '/home/user/projects/zdecisionpkg'
}

Node.js v20.12.0

 

Experts -please advise.

Regards,

Saritha

AvaneeshPEOL
Explorer
0 Kudos
cds watch seems to be working for me, but the mta build is still failing for the same reason