is-promise: ERR_INVALID_PACKAGE_TARGET
The module fails to import with node v13.12.0. The version 2.1.0 still works fine.
sorunome@sorunome-desktop repos/mx-puppet-skype $ node ./build/index.js 1
internal/modules/cjs/loader.js:616
if (e.code !== 'ERR_PACKAGE_PATH_NOT_EXPORTED') throw e;
^
Error [ERR_INVALID_PACKAGE_TARGET]: Invalid "exports" main target "index.js" defined in the package config /home/sorunome/repos/mx-puppet-skype/node_modules/is-promise/package.json
at resolveExportsTarget (internal/modules/cjs/loader.js:574:13)
at resolveExportsTarget (internal/modules/cjs/loader.js:613:20)
at applyExports (internal/modules/cjs/loader.js:503:14)
at resolveExports (internal/modules/cjs/loader.js:541:12)
at Function.Module._findPath (internal/modules/cjs/loader.js:661:22)
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:963:27)
at Function.Module._load (internal/modules/cjs/loader.js:859:27)
at Module.require (internal/modules/cjs/loader.js:1036:19)
at require (internal/modules/cjs/helpers.js:72:18)
at Object.<anonymous> (/home/sorunome/repos/mx-puppet-skype/node_modules/lowdb/lib/main.js:4:17) {
code: 'ERR_INVALID_PACKAGE_TARGET'
}
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 29
- Comments: 24 (2 by maintainers)
Links to this issue
Commits related to this issue
- chore: fix is-promise - tracking https://github.com/then/is-promise/issues/13 — committed to ng-alain/delon by cipchk 4 years ago
- Fix invalid is-promise library error A fucking idiot published a new version of is-promise on Githu Saturday afternoon and it brake the Front end build See https://github.com/then/is-promise/issue... — committed to lunatech-labs/lunatech-timekeeper by deleted user 4 years ago
- Fixes then/is-promise#13 — committed to cryptoquick/demo-cra-ts by cryptoquick 4 years ago
Fyi, this is on hackernews, expect a lot attention/comments/shitposting.
😂 holy shit 😂 JS ecosystem is just utterly broken beyond any repair.
The left pad fiasco all over. https://www.theregister.co.uk/2016/03/23/npm_left_pad_chaos/
It’s a single line of code. Why do we need a package for this?
If you’re using Yarn here’s a fix:
yarn why is-promiseis-promise, pin the resolution. In my case,serverlesswas installingrun-asyncandmemoizee, which each had their own copy ofis-promise. I added the following key to mypackage.json:Then I
rm -rf’d the directories withrun-asyncandmemoizeeand reinstalled them usingyarn add. Works for me 👍so this is resolved?
https://deno.land/ piling on the bandwagon
If you are on NPM, run: npm install is-promise@2.1.0 --save --save-exact
It should now be resolved. Since there are 4 issues about this, I’m going to close this issue in favour of #20. Please comment there if 2.2.1 does not fix your issue.
but how to do it to create a new project using npx create-react-app?
Nope, and it’s broken serverless for me 😦
Version 2.2.1 released: https://github.com/then/is-promise/releases/tag/2.2.1
This also seems to be affecting latest on firebase-tools.
If you’re using npm, you can fix the issue by editing your
package-lock.jsonfile like so.Identify the modules that are using the failing
is-promisemodules:Move the
is-promiseout ofrequiresand create a new objectdependencies:Next, rerun
npm install --only=devand you should be good.(If using yarn, see comment #13)