You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The addition of postinstall script (#218) causes the module to fail installation as a client library. That's due to the missing postinstall/edc-openapi.js which is never uploaded to the npm registry.
npm ERR! code 1
npm ERR! path /Users/federico/temp/node_modules/@think-it-labs/edc-connector-client
npm ERR! command failed
npm ERR! command sh -c node postinstall/edc-openapi.js
npm ERR! node:internal/modules/cjs/loader:1080
npm ERR! throw err;
npm ERR! ^
npm ERR!
npm ERR! Error: Cannot find module '/Users/federico/temp/node_modules/@think-it-labs/edc-connector-client/postinstall/edc-openapi.js'
npm ERR! at Module._resolveFilename (node:internal/modules/cjs/loader:1077:15)
npm ERR! at Module._load (node:internal/modules/cjs/loader:922:27)
npm ERR! at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:86:12)
npm ERR! at node:internal/main/run_main_module:23:47 {
npm ERR! code: 'MODULE_NOT_FOUND',
npm ERR! requireStack: []
npm ERR! }
npm ERR!
npm ERR! Node.js v18.18.2
npm ERR! A complete log of this run can be found in: /Users/federico/.npm/_logs/2024-05-13T20_10_18_653Z-debug-0.log
If applicable, explain your vision on how this issue should be fixed
I don't think we should rely on postinstall for downloading the EDC OpenAPI specification - there shouldn't be any need to do so every time we install (or initialise) the module into a project.
I'd suggest to to have an explicit script (e.g., download-edc-openapi) which is programmatically called only when necessary (npm run download-edc-openapi or yarn download-edc-openapi).
The text was updated successfully, but these errors were encountered:
that's interesting, I thought it was something only related to install for development, not for "production use", for which that script is definitely not needed.
I'm looking at the docs and indeed looks there's no out-of-the-box solution 😮
At this point I'd move the script execution in the pretest step, it's a pity because it gets executed everytime we run yarn test, it will give a better dev experience than a manual script to be run
EDIT: super-question, if I install a library, will all the devDependencies be downloaded as well? if so, that's not great 🥲
super-question, if I install a library, will all the devDependencies be downloaded as well? if so, that's not great
If I remember correctly devDependencies should only be downloaded for development purposes; npm install somepackage should only consider downloading direct dependencies. That should be the point of the separation 👀
Check for existing issues
Describe the bug
The addition of postinstall script (#218) causes the module to fail installation as a client library. That's due to the missing postinstall/edc-openapi.js which is never uploaded to the npm registry.
Provide steps to reproduce it
Output
If applicable, explain your vision on how this issue should be fixed
I don't think we should rely on
postinstall
for downloading the EDC OpenAPI specification - there shouldn't be any need to do so every time we install (or initialise) the module into a project.I'd suggest to to have an explicit
script
(e.g.,download-edc-openapi
) which is programmatically called only when necessary (npm run download-edc-openapi
oryarn download-edc-openapi
).The text was updated successfully, but these errors were encountered: