jaredpalmer / tsdx

Zero-config CLI for TypeScript package development
https://tsdx.io
MIT License
11.28k stars 507 forks source link

core-js postinstall error when installing tsdx in a node snap env #792

Closed daniel100097 closed 4 years ago

daniel100097 commented 4 years ago

Hello,

I'm getting the folowing error by installing tsdx globaly. Nodejs runs on my system in a snap package, thats probably the reason why im getting this error.

$sudo npm install -g tsdx
npm WARN deprecated rollup-plugin-babel@4.4.0: This package has been deprecated and is no longer maintained. Please use @rollup/plugin-babel.
npm WARN deprecated core-js@2.6.11: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm WARN deprecated left-pad@1.3.0: use String.prototype.padStart()
npm WARN deprecated request-promise-native@1.0.9: request-promise-native has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
/usr/local/bin/tsdx -> /usr/local/lib/node_modules/tsdx/dist/index.js
npm WARN lifecycle The node binary used for scripts is /snap/bin/node but npm is using /snap/node/2865/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.

> core-js@2.6.11 postinstall /usr/local/lib/node_modules/tsdx/node_modules/core-js
> node -e "try{require('./postinstall')}catch(e){}"

2020/08/10 11:34:34.334466 cmd_run.go:918: WARNING: cannot create user data directory: Kann "/nonexistent/snap/node/2865" nicht erstellen: mkdir /nonexistent: permission denied
cannot create user data directory: /nonexistent/snap/node/2865: Permission denied
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.7 (node_modules/tsdx/node_modules/jest-haste-map/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! core-js@2.6.11 postinstall: `node -e "try{require('./postinstall')}catch(e){}"`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the core-js@2.6.11 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2020-08-10T09_34_35_154Z-debug.log

Current Behavior

Crashed by installing tsdx globaly

Software Version(s)
TSDX latest
TypeScript 3.8.3
Browser none
npm/Yarn npm
Node v14.7.0
Operating System ubuntu 20.04
snap 2.45.2
snapd 2.45.2
series 16
ubuntu 20.04
kernel 5.4.0-42-generic

image

agilgur5 commented 4 years ago

@daniel100097 TSDX should still work despite that error, pretty sure that is just corejs failing to show it's donation message on postinstall, so nothing important missed. It also might not happen on second install, I can't remember.

Have had that happen to me a number of times when installing all kinds of packages; it's an error in a deprecated version of core-js which a lot of packages use and is more than a level up upstream.

It is a fairly common error relating to https://github.com/zloirock/core-js/issues/843 / https://github.com/zloirock/core-js/issues/831 and previously https://github.com/zloirock/core-js/issues/673 / https://github.com/zloirock/core-js/issues/591 / https://github.com/zloirock/core-js/issues/582 / https://github.com/zloirock/core-js/issues/551