-
Notifications
You must be signed in to change notification settings - Fork 5
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
The npm package does not have compiled .js files #22
Comments
related: > const sh = require('structured-headers');
Uncaught:
Error: Cannot find module '/home/liminal18/Programs/nodeJS/digital_bazaar/http-signature-header/node_modules/structured-headers/index.js'. Please verify that the package.json has a valid "main" entry
at tryPackage (internal/modules/cjs/loader.js:303:19)
at Function.Module._findPath (internal/modules/cjs/loader.js:516:18)
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:867:27)
at Function.Module._load (internal/modules/cjs/loader.js:725:27)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18) {
code: 'MODULE_NOT_FOUND',
path: '/home/liminal18/Programs/nodeJS/digital_bazaar/http-signature-header/node_modules/structured-headers/package.json',
requestPath: 'structured-headers'
}
> .exit
[liminal18@nixos:~/Programs/nodeJS/digital_bazaar/http-signature-header]$ ls node_modules/structured-headers/
changelog.md Makefile package.json readme.md src test tsconfig.json tslint.json webpack.config.js
node -v
v14.15.1 |
Given that it's a typescript package, I believe this import style should work in javascript:
If that fails, i'll dig a bit deeper. This package needs some work to be back up to date with the current standard though, it's been a bit hard to find time =( |
If there is interest in adopting this, I can spend some time fully bringing this up to par with the latest standards. Something I planned to do anyway, but I can potentially prioritize this |
As the Signing HTTP Headers specification now uses structured fields it might be a good idea. The spec that brought me here. I tried your import method: const sh = require('structured-headers').default;
Uncaught:
Error: Cannot find module '/home/liminal18/Programs/nodeJS/digital_bazaar/http-signature-header/node_modules/structured-headers/index.js'. Please verify that the package.json has a valid "main" entry
at tryPackage (internal/modules/cjs/loader.js:303:19)
at Function.Module._findPath (internal/modules/cjs/loader.js:516:18)
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:867:27)
at Function.Module._load (internal/modules/cjs/loader.js:725:27)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18) {
code: 'MODULE_NOT_FOUND',
path: '/home/liminal18/Programs/nodeJS/digital_bazaar/http-signature-header/node_modules/structured-headers/package.json',
requestPath: 'structured-headers'
} still doesn't work. The issue I'm running into is that HTTP signatures are both front end and back end and the other structured fields library uses the node only |
This library was several drafts behind, and instead of trying to get it up to date with the current RFC, I rewrote it yesterday. The new parser passes all official tests, but the serializer is not done yet. I've kept the 'No buffer' requirement in mind, so the eventual release will use If this can wait a few more days, I can have a fully functioning npm package ready to go. |
The example in README.md does not work:
It looks the npm package does not have
dist/
andbrowser/
directories, probably because these are listed in.gitignore
and there's no.npmignore
file.Also,
"main": "index.js"
inpackage.json
should be"main": "dist/index.js"
.The text was updated successfully, but these errors were encountered: