jaredpalmer / tsdx

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

core-js postinstall error when installing with npx on a snap env #897

Closed RobJacobson closed 3 years ago

RobJacobson commented 3 years ago

Current Behavior

  1. Follow quickstart:
    $ sudo npx tsdx create mylib
  2. Get error message:
    2020/10/06 18:41:27.713057 cmd_run.go:991: WARNING: cannot create user data directory: cannot create "/nonexistent/snap/node/3128": mkdir /nonexistent: permission denied
    cannot create user data directory: /nonexistent/snap/node/3128: Permission denied
    npm ERR! code ELIFECYCLE
    npm ERR! errno 1
    npm ERR! core-js-pure@3.6.5 postinstall: `node -e "try{require('./postinstall')}catch(e){}"`
    npm ERR! Exit status 1
    npm ERR! 
    npm ERR! Failed at the core-js-pure@3.6.5 postinstall script.
    npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

Expected behavior

An installation of the project mylib.

Suggested solution(s)

Unsure

Additional context

I recently did a clean install of Linux Mint 20 along with Node version 12.19.0.

Your environment

npx: installed 1 in 0.86s

  System:
    OS: Linux 5.4 Linux Mint 20 (Ulyana)
    CPU: (8) x64 Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz
    Memory: 1.47 GB / 15.52 GB
    Container: Yes
    Shell: 5.0.17 - /bin/bash
  Browsers:
    Chrome: 86.0.4240.75
RobJacobson commented 3 years ago

Here is the full debug.log file from Node. debug.log

agilgur5 commented 3 years ago

Duplicate of #792

RobJacobson commented 3 years ago

Can you please explain why you closed this? I'm reading #792 (which is closed), but not finding a solution. This seems to be an active bug.

As someone new to TSDX, this is not a great "first impression." I'm following your QuickStart documentation to the letter, and TSDX consistently crashes. Is there a solution, or should I just avoid TSDX?

agilgur5 commented 3 years ago

Can you please explain why you closed this?

Because the issue is not with TSDX, and neither is #792. And it is a duplicate and that was already responded to.

As someone new to TSDX, this is not a great "first impression." I'm following your QuickStart documentation to the letter, and TSDX consistently crashes. Is there a solution, or should I just avoid TSDX?

core-js isn't not a direct dependency and is used by literally millions of repos -- if you're running into this, you'll run into it with millions of installs, not just TSDX. It does not install it directly and does not do anything special with it (or at all) as such.

I'm reading #792 (which is closed), but not finding a solution. This seems to be an active bug.

I linked in #792 to a google search that returns dozens (if not more) of results as well as several upstream issues, which do offer a variety of fixes. They also suggest the issue is with your particular environment. This isn't an issue in TSDX, but despite that, I offered you and the person who filed that quite a bit of help with several links nonetheless. I cannot do anything to fix the issue you're encountering with core-js myself. I'm not a maintainer of core-js and I can't change your environment for you.

Issues are not a forum for debugging help, especially for things not within TSDX. Please search Google, StackOverflow, etc for help. Please search upstream for issues that are upstream. Please search issues before filing duplicates.

agilgur5 commented 3 years ago

FYI, this dependency is more than 4 levels upstream:

$ npm ls core-js-pure
tsdx@0.14.0 /Users/...
└─┬ eslint-plugin-jsx-a11y@6.2.3
  └─┬ axobject-query@2.1.1
    └─┬ @babel/runtime-corejs3@7.7.4
      └── core-js-pure@3.4.7 

eslint-plugin-jsx-a11y isn't even a direct dependency itself, it's a peerDep of eslint-config-react-app, so you could even consider that as 5 levels upstream.