Package exports do not define a valid '.' target
See original GitHub issueI’m having issues with importing jssha
G:\Mierda\testnpm>npx nodemon
[nodemon] 2.0.4
[nodemon] to restart at any time, enter `rs`
[nodemon] watching path(s): *.*
[nodemon] watching extensions: js,mjs,json
[nodemon] starting `node index.js`
internal/modules/cjs/loader.js:463
throw e;
^
Error: Package exports for 'G:\Mierda\testnpm\node_modules\jssha' do not define a valid '.' target
at resolveExportsTarget (internal/modules/cjs/loader.js:460:13)
at resolveExports (internal/modules/cjs/loader.js:393:16)
at Function.Module._findPath (internal/modules/cjs/loader.js:492:20)
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:787:27)
at Function.Module._load (internal/modules/cjs/loader.js:693:27)
at Module.require (internal/modules/cjs/loader.js:864:19)
at require (internal/modules/cjs/helpers.js:74:18)
at Object.<anonymous> (G:\Mierda\testnpm\index.js:1:15)
at Module._compile (internal/modules/cjs/loader.js:971:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1011:10) {
code: 'MODULE_NOT_FOUND'
}
[nodemon] app crashed - waiting for file changes before starting...
index.js has:
const jssha = require('jssha');
Extra info:
G:\Mierda\testnpm>npm version
{
testnpm: '1.0.0',
npm: '6.12.0',
ares: '1.15.0',
brotli: '1.0.7',
cldr: '35.1',
icu: '64.2',
llhttp: '1.1.4',
modules: '79',
napi: '5',
nghttp2: '1.39.2',
node: '13.0.1',
openssl: '1.1.1d',
tz: '2019a',
unicode: '12.1',
uv: '1.33.1',
v8: '7.8.279.17-node.14',
zlib: '1.2.11'
}```
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Error: Package exports for tslib do not define a valid '.' target
I had a similar issue and I workarounded by downgrading node version (from v13.0.1 to v12.19.0). It's probably not the ideal solution, ...
Read more >node v13.0-v13.1 errors on require of a module with " ...
I get this error: Error: Package exports for 'path/to/package' do not define a valid '.' target when, in the node v13.1 repl (where...
Read more >Package exports
Target environment independent packages. These patterns make sense for packages that do not use environment specific APIs. Providing only an ESM version.
Read more >Ionic cli error: package exports invalid
Error : Package exports for '/usr/local/lib/node_modules/@ionic/cli/node_modules/uuid' do not define a valid '.' target.
Read more >Error: Package exports for '/app/node_modules/uuid' do not ...
Coding example for the question Error: Package exports for '/app/node_modules/uuid' do not define a valid '.' target-node.js.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@canpoyrazoglu I’ll cut v3.1.2 tomorrow morning
Not sure if it’s related but on React Native I’m also getting an error like: