Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems with peer dependencies in Angular #19

Open
root30 opened this issue Nov 8, 2018 · 5 comments
Open

Problems with peer dependencies in Angular #19

root30 opened this issue Nov 8, 2018 · 5 comments

Comments

@root30
Copy link

root30 commented Nov 8, 2018

Version: 7.20.0

I run Angular 7:

CLI: "@angular/cli": "^7.0.4"

    "@angular/animations": "^7.0.2",
    "@angular/common": "^7.0.2",
    "@angular/compiler": "^7.0.2",
    "@angular/core": "^7.0.2",
    "@angular/forms": "^7.0.2",
    "@angular/http": "^7.0.2",
    "@angular/platform-browser": "^7.0.2",
    "@angular/platform-browser-dynamic": "^7.0.2",
    "@angular/router": "^7.0.2"

and I have issues installing/using your module.

Code:

npm WARN [email protected] requires a peer of @angular/common@5 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of @angular/core@5 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of @angular/forms@5 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of @angular/common@6 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of @angular/core@6 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of @angular/common@6 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of @angular/core@6 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of @angular/forms@6 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of @angular/common@6 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of @angular/core@6 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of @angular/forms@6 but none is installed. You must install peer dependencies yourself.

And if I install the dependencies manually and run the app:

ERROR in node_modules/angular-schema-based-json-editor/dist/index.component.d.ts(66,35): error TS2307: Cannot find module 'schema-based-json-editor/node_modules/markdown-tip'.
node_modules/schema-based-json-editor/dist/index.d.ts(385,8): error TS1192: Module '"<path to project>/node_modules/@types/dragula/index"' has no default export.
node_modules/schema-based-json-editor/dist/index.d.ts(386,8): error TS1192: Module '"<path to project>/node_modules/@types/markdown-it/index"' has no default export.
node_modules/schema-based-json-editor/dist/index.d.ts(386,22): error TS2305: Module '"<path to project>/node_modules/@types/markdown-it/index"' has no exported member 'MarkdownIt'.
node_modules/schema-based-json-editor/dist/index.d.ts(386,34): error TS2305: Module '"<path to project>/node_modules/@types/markdown-it/index"' has no exported member 'Token'.
node_modules/schema-based-json-editor/dist/index.d.ts(386,54): error TS2305: Module '"<path to project>/node_modules/@types/markdown-it/index"' has no exported member 'Renderer'.
node_modules/schema-based-json-editor/dist/index.d.ts(387,8): error TS1192: Module '"<path to project>/node_modules/@types/highlight.js/index"' has no default export.

Can you reproduce this issue?

@plantain-00
Copy link
Owner

v7.20.1 should fix this.
You may need to uninstall it first.

@root30
Copy link
Author

root30 commented Nov 8, 2018

Great, thank you! Works as intended.

@root30 root30 closed this as completed Nov 8, 2018
@root30
Copy link
Author

root30 commented Dec 7, 2018

I closed this issue too early. I somehow still fail to run your module properly:

ERROR in node_modules/angular-schema-based-json-editor/dist/index.component.d.ts(66,35): error TS2307: Cannot find module schema-based-json-editor/node_modules/markdown-tip.

node_modules/schema-based-json-editor/dist/index.d.ts(385,8): error TS1192: Module "<path to project>/node_modules/@types/dragula/index" has no default export.

node_modules/schema-based-json-editor/dist/index.d.ts(386,8): error TS1192: Module "<path to project>/node_modules/@types/highlight.js/index" has no default export.

@root30 root30 reopened this Dec 7, 2018
@plantain-00
Copy link
Owner

The first issue caused by the generated code by ngc from markdownTipLocale: defaultMarkDownTipLocale, to markdownTipLocale: import("schema-based-json-editor/node_modules/markdown-tip").Data[];, I don't know why.

The 2nd and 3nd issues seems can be solved by enabling esModuleInterop in tsconfig.json

@plantain-00
Copy link
Owner

I investigated it later, and found it is caused by typescript, v7.20.2 should fix the first issue

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

No branches or pull requests

2 participants