Skip to content
This repository has been archived by the owner on Jul 14, 2023. It is now read-only.

Cannot find module '@sap/cds/bin/build/buildTaskHandlerFactory' #52

Open
pwasem opened this issue Sep 6, 2021 · 19 comments
Open

Cannot find module '@sap/cds/bin/build/buildTaskHandlerFactory' #52

pwasem opened this issue Sep 6, 2021 · 19 comments
Assignees

Comments

@pwasem
Copy link

pwasem commented Sep 6, 2021

Description

When running npx cds-dbm deploy I am getting this error:

Cannot find module '@sap/cds/bin/build/buildTaskHandlerFactory'
Require stack:
- /workspace/node_modules/cds-dbm/dist/build/buildTaskHandlerFactory.js
- /workspace/node_modules/cds-dbm/dist/build/buildTaskFactory.js
- /workspace/node_modules/cds-dbm/dist/cli/build.js
- /workspace/node_modules/yargs/index.cjs
- /workspace/node_modules/cds-dbm/dist/cli.js

@sap/cds/bin/build/buildTaskHandlerFactory has probably been removed with a recent version of @sap/cds.

Dependencies

{
  "dependencies": {
    "@sap/cds": "^5.4.3",
    "@sap/cds-odata-v2-adapter-proxy": "^1.7.10",
    "cds-dbm": "^0.0.27",
    "cds-pg": "^0.1.8",
    "express": "^4.17.1"
  },
  "devDependencies": {
    "@sap/eslint-plugin-cds": "^2.0.5",
    "eslint": "^7.32.0",
    "eslint-config-standard": "^16.0.3",
    "eslint-plugin-import": "^2.24.2",
    "eslint-plugin-node": "^11.1.0",
    "eslint-plugin-promise": "^5.1.0",
    "sqlite3": "^5.0.2"
  }
}

Versions

@sap/cds: 5.4.3
@sap/cds-compiler: 2.5.2
@sap/cds-dk: 3.5.3
@sap/cds-foss: 3.0.0
@sap/cds-odata-v2-adapter-proxy: 1.7.10
@sap/eslint-plugin-cds: 2.0.5
Node.js: v14.17.6

Thanks in advance for having a look at this!

@Regloom
Copy link
Contributor

Regloom commented Sep 13, 2021

That's because of npm version on cloud foundry instance (not related to cds-dbm).

You may manually install cds package by executing: "npm install @sap/[email protected]" on db-deployer instance.

@pwasem
Copy link
Author

pwasem commented Sep 14, 2021

@Regloom
The service is not running in a cloud foundry scenario. All locally in a dev container.

How could this issue be related to the npm version which is 6.14.15?

@LotharBender
Copy link
Contributor

LotharBender commented Sep 14, 2021

@pwasem - cds-dpm version 0.0.27 does not support @sap/cds version 5.4.x. You have to install @sap/cds version < 5.4.0 as cds-dpm needs to be migrated, first. See https://github.com/gregorwolf/cds-dbm/tree/fix/issue-34

@mikezaschka
Copy link
Owner

Sadly I am really head under water kind of busy right now and won't find any time to adjust the library within the next two weeks. I plan on providing an updated version shortly after that.

@mikezaschka
Copy link
Owner

mikezaschka commented Oct 5, 2021

Fixed this and also got rid of the cds-dbm build task, since it nows works in combination with cds build.
Thank you @LotharBender for providing the patch and obviously also for changing the internal API.

I am going to do some more tests tomorrow and then release an new version of cds-dbm which is compatible with the latest @sap/cds and cds-pg versions.

@mikezaschka mikezaschka self-assigned this Oct 5, 2021
@LotharBender
Copy link
Contributor

@mikezaschka - in order to be on the save side in respect to future refactoring I recommend to replace the dependency BuildTaskHandlerInternal by BuildTaskHandler.

@gregorwolf
Copy link
Collaborator

@mikezaschka can you create a release with this adjustment? I'm trying my pg-beershop with the new cds-pg release but currently run into this issue when I try to deploy.

@edwin7
Copy link

edwin7 commented Oct 29, 2021

@mikezaschka, I have same issue as Gregor

@isreven
Copy link

isreven commented Nov 2, 2021

Hi @mikezaschka, regarding this issue, Is there a release with a correction of this matter?

@Regloom
Copy link
Contributor

Regloom commented Nov 3, 2021

Hi @mikezaschka, regarding this issue, Is there a release with a correction of this matter?

With the following dependencies in package.json it works fine:
...
"dependencies": {
"@sap/cds": "5.1.5",
"@sap/cds-odata-v2-adapter-proxy": "1.7.1",
"@sap/xsenv": "3.1.1",
"@sap/xssec": "3.2.9",
"cds-pg": "0.1.6",
"cds-dbm": "0.0.27"
}
...

p.s. make sure "^" is not present in the beginning of the version otherwise recent versions of packages will be downloaded.

@T1mey
Copy link

T1mey commented Nov 8, 2021

Hi @mikezaschka, regarding this issue, Is there a release with a correction of this matter?

With the following dependencies in package.json it works fine: ... "dependencies": { "@sap/cds": "5.1.5", "@sap/cds-odata-v2-adapter-proxy": "1.7.1", "@sap/xsenv": "3.1.1", "@sap/xssec": "3.2.9", "cds-pg": "0.1.6", "cds-dbm": "0.0.27" } ...

p.s. make sure "^" is not present in the beginning of the version otherwise recent versions of packages will be downloaded.

Having the same problem on SAP BAS.
Can I switch back to an actual version of cds after the generation ?

@T1mey
Copy link

T1mey commented Nov 17, 2021

@mikezaschka any information when the postgres db can be used with the latest version of SAP CAP ?
Actual we're not able to bring our application online cause cap 5.1.x is buggy & features like virtual fields are only support with newer version.

@gregorwolf
Copy link
Collaborator

If you have the urgent need you have the option to hire @mikezaschka or invest your own time to bing it to work with the lastest CAP Version. If support from SAP is needed we can involve @ sjvans

@isreven
Copy link

isreven commented Nov 17, 2021

Hi @gregorwolf
Thanks for your response.
Can you please share with me the contact information of @sjvans?

@gregorwolf
Copy link
Collaborator

As you've mentioned @sjvans he will get notified. First check if cds-pg works with the latest CAP version if not contribute there. Then try to fix the cds-dbm issue. If it's an issue caused by sap/cds we must involve @sjvans.

@emanlaham
Copy link

Hi @gregorwolf ,

Can you clarify who @sjvans is? ie full email address please, so that we can check with them this urgent issue?

Thank you, Eman

@gregorwolf
Copy link
Collaborator

I will not provide you an email address. This is an open source project. If you have urgent issues you have either to wait, help yourself or reach out to the contributors if they can help on short term when you pay them.

I've just updated the branch test-cds-5.6) of my pg-beershop. There I can now at least get the DB schema deployed to my local docker PostgreSQL instance. You have to make sure that this branch of cds-dbm and pg-beershop have the same main folder. Also make sure that you've built the cds-dbm typescript sources.

@ClarkDennison
Copy link

Any word on the new release to resolve this issue? Thanks for all the hard work.
-Clark

@Bonny88
Copy link
Contributor

Bonny88 commented Jan 10, 2022

Hi @ClarkDennison,

the main branch is already updated with the latest @sap/cds reference and the issue is therefore fixed. We are waiting for @mikezaschka to release the new package on npm.

In the meantime you can refer to this branch and compile the typescript library locally.

Regards
Bonny

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests