api-platform / create-client

Generate React or Vue.js-based Progressive Web Apps from an Hydra-enabled API. Also support React Native.
https://api-platform.com/docs/client-generator/
MIT License
373 stars 132 forks source link

Client generator fails with a missing module #297

Closed b2p-fred closed 3 years ago

b2p-fred commented 3 years ago

API Platform version(s) affected: 2.6.x

Description
As already reported here: https://github.com/api-platform/api-platform/issues/1800, the client generator ends with an error:

npx @api-platform/client-generator https://localhost . --generator next --resource greeting
internal/modules/cjs/loader.js:892
  throw err;
  ^

Error: Cannot find module '/root/.npm/_npx/215/lib/node_modules/@api-platform/client-generator/node_modules/highlight.js/deprecated.js'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:889:15)
    at Function.Module._load (internal/modules/cjs/loader.js:745:27)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76: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-08-25T07_05_07_224Z-debug.log
Install for [ '@api-platform/client-generator@0.6.0' ] failed with code 1

How to reproduce
Run the npx @api-platform/client-generator command locally or in a docker container

b2p-fred commented 3 years ago

Closing thanks to the recent comments in api-platform/api-platform#1800