gulp-terser
gulp-terser copied to clipboard
[Question] No valid exports main exception
Apologies if this is a very simple solution! Just starting out with gulp. When I run the how to use example, I get the following exception:
Error: No valid exports main found for '----/node_modules/terser'
at resolveExportsTarget (internal/modules/cjs/loader.js:625:9)
at applyExports (internal/modules/cjs/loader.js:502:14)
at resolveExports (internal/modules/cjs/loader.js:551:12)
at Function.Module._findPath (internal/modules/cjs/loader.js:657:22)
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:960:27)
at Function.Module._load (internal/modules/cjs/loader.js:855:27)
at Module.require (internal/modules/cjs/loader.js:1033:19)
at require (internal/modules/cjs/helpers.js:72:18)
at Object.<anonymous> (------/node_modules/gulp-terser/lib/index.js:7:38)
at Module._compile (internal/modules/cjs/loader.js:1144:30) {
code: 'MODULE_NOT_FOUND'
Can anyone advise whats causing this?
node v13.6.0
Apologies if this is a very simple solution! Just starting out with gulp. When I run the how to use example, I get the following exception:
Error: No valid exports main found for '----/node_modules/terser' at resolveExportsTarget (internal/modules/cjs/loader.js:625:9) at applyExports (internal/modules/cjs/loader.js:502:14) at resolveExports (internal/modules/cjs/loader.js:551:12) at Function.Module._findPath (internal/modules/cjs/loader.js:657:22) at Function.Module._resolveFilename (internal/modules/cjs/loader.js:960:27) at Function.Module._load (internal/modules/cjs/loader.js:855:27) at Module.require (internal/modules/cjs/loader.js:1033:19) at require (internal/modules/cjs/helpers.js:72:18) at Object.<anonymous> (------/node_modules/gulp-terser/lib/index.js:7:38) at Module._compile (internal/modules/cjs/loader.js:1144:30) { code: 'MODULE_NOT_FOUND'
Can anyone advise whats causing this?
node
v13.6.0
Can you provide a demo for me to test?
I was seeing the same error, so I upgraded to node v14.12.0
and now it works.
BTW gulp-terser
is great, thanks a lot 👍