question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Client generator fail to generate scaffold for greeting resource

See original GitHub issue

API Platform version(s) affected: 2.6.1

Description
When I run: docker-compose exec pwa npx @api-platform/client-generator https://localhost . --generator next --resource greeting

I have the following error stack trace

internal/modules/cjs/loader.js:883
  throw err;
  ^

Error: Cannot find module '/root/.npm/_npx/152/lib/node_modules/@api-platform/client-generator/node_modules/highlight.js/deprecated.js'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)
    at Function.Module._load (internal/modules/cjs/loader.js:725:27)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
    at internal/main/run_main_module.js:17:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! highlight.js@9.18.5 postinstall: `node deprecated.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the highlight.js@9.18.5 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2021-02-06T17_51_05_067Z-debug.log
Install for [ '@api-platform/client-generator@latest' ] failed with code 1

How to reproduce
1: Install api-platform 2.6.1 2: run docker-compose exec pwa npx @api-platform/client-generator https://localhost . --generator next --resource greeting

Additional context I don’t know if the endpoint https://localhost is the good value to put there. And I don’t know if this is expected that I run this generation from pwa container.But I didn’t find an example in the documentation related to the Api-Platform default setup with Docker.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:3
  • Comments:5

github_iconTop GitHub Comments

2reactions
b2p-fredcommented, Aug 26, 2021

@gusdecool many thanks for your comment. I should have carefully read your former comment 😉

1reaction
gusdecoolcommented, Feb 15, 2021

use versioned package. Looks like latest version are unstable.

try this, add the api platform into your local dependencies

"dependencies": {
    "@api-platform/client-generator": "^0.6.0",
}

the run

npx generate-api-platform-client --generator typescript http://localhost src/

btw, you may want to use http:// in case your certificate self signed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

goagen, the goa Tool · goa :: Design-first API Generation
goagen is a tool that generates various artifacts from a goa design package. Install it with: go install github.com/goadesign/goa/goagen.
Read more >
Rails: How to run `rails generate scaffold` when the model ...
I tried to generate the scaffolding but I got an error saying a migration file with the same name already exists. Agree with...
Read more >
Localize SharePoint Framework client-side web parts
In the project folder, run the SharePoint Framework Yeoman generator to scaffold a new SharePoint Framework project. sh. Copy. yo @microsoft/ ...
Read more >
Using Genie Plugins · Genie - The Highly Productive Julia Web ...
The installation will add a new hello resource in app/resources/hello/ in the ... provides an efficient scaffold for creating a new Genie plugin...
Read more >
Creating Your First Application - Quarkus
In this guide, we create a straightforward application serving a hello endpoint. ... GreetingResource resource exposed on /hello. an associated unit test.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found