Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No such file or directory (WSL, Ubuntu 19.10) #594

Closed
ScarletFlash opened this issue Oct 29, 2019 · 20 comments
Closed

No such file or directory (WSL, Ubuntu 19.10) #594

ScarletFlash opened this issue Oct 29, 2019 · 20 comments

Comments

@ScarletFlash
Copy link

Bug Report

Summary

Can not install latest node.js via n on Ubuntu 19.10 (WSL)

Steps to Reproduce

sudo n latest

Expected Behaviour

latest node.js version is installed

Actual Behaviour

cp: cannot stat '/usr/local/n/versions/node/13.0.1/lib': No such file or directory
cp: cannot stat '/usr/local/n/versions/node/13.0.1/bin': No such file or directory
cp: cannot stat '/usr/local/n/versions/node/13.0.1/include': No such file or directory
cp: cannot stat '/usr/local/n/versions/node/13.0.1/share': No such file or directory
/usr/bin/n: line 566: /usr/local/bin/node: No such file or directory
   installed : 

Configuration Details

$ n --version
6.1.0

$ command -v node
/usr/bin/node

$ node -p process.platform
linux
@ScarletFlash
Copy link
Author

ScarletFlash commented Oct 29, 2019

#368 - relative issue

@shadowspawn
Copy link
Collaborator

It looks like the tarball download or expansion produced no folders, but did not fail the install. Do you see any other messages during the install?

Worth trying sudo n doctor in case it picks up something.

The related issue mentions proxy, are you behind a proxy?

@ScarletFlash
Copy link
Author

It looks like the tarball download or expansion produced no folders, but did not fail the install. Do you see any other messages during the install?

Worth trying sudo n doctor in case it picks up something.

The related issue mentions proxy, are you behind a proxy?

No, I'm not behind proxy.
sudo n doctor did not help.

@shadowspawn
Copy link
Collaborator

Can you install other versions? e.g.

sudo n lts

If you got a one-off network failure, it could leave behind a broken folder. You could try deleting it and installing again:

sudo n rm 13.0.1
sudo latest

@ScarletFlash
Copy link
Author

Can you install other versions? e.g.

sudo n lts

Same problem here:

cp: cannot stat '/usr/local/n/versions/node/12.13.0/lib': No such file or directory
cp: cannot stat '/usr/local/n/versions/node/12.13.0/bin': No such file or directory
cp: cannot stat '/usr/local/n/versions/node/12.13.0/include': No such file or directory
cp: cannot stat '/usr/local/n/versions/node/12.13.0/share': No such file or directory
/usr/bin/n: line 566: /usr/local/bin/node: No such file or directory
   installed : 

@ScarletFlash
Copy link
Author

ScarletFlash commented Oct 29, 2019

sudo n rm 13.0.1

13.0.1 (13.0.1) not in downloads cache

sudo n latest

  installing : node-v13.0.1
       mkdir : /usr/local/n/versions/node/13.0.1
       fetch : https://nodejs.org/dist/v13.0.1/node-v13.0.1-linux-x64.tar.gz
/bin/gzip: 10: Syntax error: "(" unexpected
       tar:  Child died with signal 13 
 tar:  Error is not recoverable: exiting now
                                                                                                                    0.0%
cp: cannot stat '/usr/local/n/versions/node/13.0.1/lib': No such file or directory
cp: cannot stat '/usr/local/n/versions/node/13.0.1/bin': No such file or directory
cp: cannot stat '/usr/local/n/versions/node/13.0.1/include': No such file or directory
cp: cannot stat '/usr/local/n/versions/node/13.0.1/share': No such file or directory
/usr/bin/n: line 566: /usr/local/bin/node: No such file or directory
   installed :

@shadowspawn
Copy link
Collaborator

Thanks for full output from install which has an important clue, unpacking the tarball is failing. Either the download is corrupt or there is a compatibility problem with the version of tar:

/bin/gzip: 10: Syntax error: "(" unexpected
       tar:  Child died with signal 13 
 tar:  Error is not recoverable: exiting now

What are your tar details? (So I can compare against what I see and try reproducing.)

 tar --version

@ScarletFlash
Copy link
Author

tar --version

tar (GNU tar) 1.30
Copyright (C) 2017 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.       
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by John Gilmore and Jay Fenlason.

@ScarletFlash
Copy link
Author

ScarletFlash commented Oct 30, 2019

Thanks for full output from install which has an important clue...

Output was always full. Some strings are not appearing sometimes.

@shadowspawn
Copy link
Collaborator

I just noticed the WSL, so I'm not going to be able to reproduce this in a docker container! 🙂

I found one similar error:

n has been working for some WSL users:

You can try the download and extract separately to try and narrow down which is failing:

curl https://nodejs.org/dist/v13.0.1/node-v13.0.1-linux-x64.tar.gz -o node-tarball
tar xf node-tarball 

@shadowspawn
Copy link
Collaborator

Output was always full. Some strings are not appearing sometimes.

I think the failed install creates a folder with the version number and further attempts fail without attempting the download again. n just tries and installs from the broken cache and hits all the missing folders. Doing the n rm <version> first makes n try again properly.

@ScarletFlash
Copy link
Author

has been working for some WSL users

Yep. I have been using n for a long time before upgrading to Ubuntu 19.10. Everything was OK on 19.04.

@shadowspawn shadowspawn changed the title No such file or directory No such file or directory (WSL) Oct 30, 2019
@ScarletFlash
Copy link
Author

Output was always full. Some strings are not appearing sometimes.

I think the failed install creates a folder with the version number and further attempts fail without attempting the download again. n just tries and installs from the broken cache and hits all the missing folders. Doing the n rm <version> first makes n try again properly.

$ sudo n rm 13.0.1 && sudo n 13.0.1

  installing : node-v13.0.1
       mkdir : /usr/local/n/versions/node/13.0.1
       fetch : https://nodejs.org/dist/v13.0.1/node-v13.0.1-linux-x64.tar.gz
/bin/gzip: 10: Syntax error: "(" unexpected
                                                                                                                                                                                                     0.0%tar: Child died with signal 13
tar: Error is not recoverable: exiting now

cp: cannot stat '/usr/local/n/versions/node/13.0.1/lib': No such file or directory
cp: cannot stat '/usr/local/n/versions/node/13.0.1/bin': No such file or directory
cp: cannot stat '/usr/local/n/versions/node/13.0.1/include': No such file or directory
cp: cannot stat '/usr/local/n/versions/node/13.0.1/share': No such file or directory
   installed : v12.12.0 (with npm 6.11.3)

But picking node version from list via sudo n works (v13.0.1 is not visible in list).

@ScarletFlash ScarletFlash changed the title No such file or directory (WSL) No such file or directory (WSL, Ubuntu 19.10) Oct 30, 2019
@ScarletFlash
Copy link
Author

As I said, everything was OK on Ubuntu 19.04, so this may be important. :)

@shadowspawn
Copy link
Collaborator

But picking node version from list via sudo n works (v13.0.1 is not visible in list).

That would make sense if you downloaded the versions in the list before you upgraded to WSL 19.10?

(Good title change, thanks. Looking like the 19.04 to 19.10 change broken something.)

@ScarletFlash
Copy link
Author

ScarletFlash commented Oct 30, 2019

But picking node version from list via sudo n works (v13.0.1 is not visible in list).

That would make sense if you downloaded the versions in the list before you upgraded to WSL 19.10?

(Good title change, thanks. Looking like the 19.04 to 19.10 change broken something.)

May be so. I'll check on my laptop. – I've made a clean installation of Ubuntu 19.10 (WSL) there.

@ScarletFlash
Copy link
Author

ScarletFlash commented Oct 30, 2019

I've made a clean installation of Ubuntu 19.10 (WSL)

On clean Ubuntu 19.10 (WSL), all options of sudo n are corrupted, but v13.0.1 is visible in list. sudo n latest is not working too.

@ScarletFlash
Copy link
Author

So, as I see, this VSCode issue (microsoft/vscode-remote-release#1744) is almost the same.

@ScarletFlash
Copy link
Author

So, temporary solution is:

  1. to follow these steps: gzip from Ubuntu Eoan doesn't execute microsoft/WSL#4461 (comment)
  2. to run sudo n rm 13.0.1 && sudo n latest

The bug is in WSL / gzip, not in your package. Thank you for your help!

@shadowspawn
Copy link
Collaborator

Glad you found the cause!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants