on 2020 Oct 08 7:19 AM
Hi community,
since this week we are facing a strange issue SAP Business Application Studio, but it worked before.
As soon we want to run the application with "cds watch" we receive:
[ERROR] TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received type undefined at validateString (internal/validators.js:125:11) at Object.join (path.js:1147:7) at getPortsFile (/home/user/projects/MYPROJECT/node_modules/ports/index.js:63:15) at Object.<anonymous> (/home/user/projects/MYPROJECT/node_modules/ports/index.js:13:29) at Module._compile (internal/modules/cjs/loader.js:778:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10) at Module.load (internal/modules/cjs/loader.js:653:32) at tryModuleLoad (internal/modules/cjs/loader.js:593:12) at Function.Module._load (internal/modules/cjs/loader.js:585:3) at Module.require (internal/modules/cjs/loader.js:692:17)
We checked the file MYPROJECT/node_modules/ports/index.js and detected, that it reads the default-environment.json and wants to have a path to a .cds-services.json.
My first thougt was, okay, let's just provide this path and create that file within my projects.
After doing this, cds watch runs without error but it runs, and runs, and runs in a endless loop.
As already mentioned, we didn't changed anything in our application. The issue still occured with the start of the week.
Also creating a completing new workspace, taking the project from GIT and trying cds watch runs into the same error. Does anybody have an idea? Is it an fault by SAP standard code, e.g. at the functions:
Received type undefined at validateString (internal/validators.js:125:11) at Object.join (path.js:1147:7)
Thanks in advance for your help!
Request clarification before answering.
Hi Gregor, thanks again.
Difference is, that we do use @sap/cds. Nevertheless, we did the following:
npm update updates
npm install
npm udate increase all version numbers in package.json, e.g. in our case also for the @sap/hana-client
--> We still received a few errors due to missing libraries. We added the libs
npm install cjs
npm install ports
Finally, it worked again. Thanks for your help!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
cds watch in my case, didn't work because of npm @sap/cds package version is old by default.npm i @sap/cds@~6after that you can see the package.json to verify it's been updated. That's it again run the
cds watchI hope it helps someone.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Did you run:
npm iFor your project?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
yes, sure.
npm install lead to the following message:
New patch version of npm available! 6.14.6 -> 6.14.8 │ │ Changelog: https://github.com/npm/cli/releases/tag/v6.14.8 │ │ Run npm install -g npm to update!
I afterwards did npm install -g npm, but without success. Still the same error
Try also:
npm i -g @sap/cds-dkas unfortunately the version coming with BAS is quite old.
| User | Count |
|---|---|
| 18 | |
| 7 | |
| 6 | |
| 6 | |
| 6 | |
| 4 | |
| 3 | |
| 3 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.