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

bug: No preset version installed for command tsc #1631

Closed
LIttleAncientForestKami opened this issue Sep 6, 2023 · 5 comments
Closed

bug: No preset version installed for command tsc #1631

LIttleAncientForestKami opened this issue Sep 6, 2023 · 5 comments
Labels

Comments

@LIttleAncientForestKami
Copy link

LIttleAncientForestKami commented Sep 6, 2023

Describe the Bug

asdf wants me to install nodejs that's already installed. Reshim does NOT help.

Steps to Reproduce

  1. npm build run # error
  2. npm run tsc # error
  3. asdf install nodejs 14.16.1 # says it's installed already
  4. asdf reshim # no visible output
  5. asdf reshim nodejs # no visible output

Steps 1 or 2 give me the error. Rest is me trying to fix, but to no avail.

Shim tsc contents

#!/usr/bin/env bash
# asdf-plugin: nodejs 19.3.0
exec ~/.asdf/bin/asdf exec "tsc" "$@" # asdf_allow: ' asdf '

I also manually added a line # asdf-plugin: nodejs 14.16.1 and:

  1. that crashed the build saying no binary
  2. I thought reshim would help then but doing asdf reshim nodejs removed that line

Expected Behaviour

Build proceeding with tsc normally, since nodejs 14.16.1 is installed.

Actual Behaviour

tsc

No preset version installed for command tsc
Please install a version by running one of the following:

asdf install nodejs 14.16.1

or add one of the following versions in your config file at /home/lafk/Kod/wyndham/aem_ui_cloud/.tool-versions
nodejs 19.3.0

Environment

OS:
Linux T480s 6.2.0-26-generic #26~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Thu Jul 13 16:27:29 UTC 2 x86_64 x86_64 x86_64 GNU/Linux

SHELL:
GNU bash, version 5.1.16(1)-release (x86_64-pc-linux-gnu)
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://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.

BASH VERSION:
5.1.16(1)-release

ASDF VERSION:
v0.12.0-816195d

ASDF INTERNAL VARIABLES:
ASDF_DEFAULT_TOOL_VERSIONS_FILENAME=.tool-versions
ASDF_DATA_DIR=~/.asdf
ASDF_DIR=~/.asdf
ASDF_CONFIG_FILE=~/.asdfrc

ASDF INSTALLED PLUGINS:
nodejs                       https://github.com/asdf-vm/asdf-nodejs.git master c9e5df4

asdf plugins affected (if relevant)

nodejs

@LIttleAncientForestKami
Copy link
Author

Version I began having this on:

$> asdf --version
v0.11.0-6a4f51a

I did asdf update to see if it resolves the issue. It did not, as per above.

@LIttleAncientForestKami
Copy link
Author

LIttleAncientForestKami commented Sep 6, 2023

$> npm i -g tsc
~/.asdf/installs/nodejs/14.16.1/bin/tsc -> ~/.asdf/installs/nodejs/14.16.1/lib/node_modules/tsc/bin/tsc
+ [email protected]
added 1 package from 1 contributor in 0.09s
Reshimming asdf nodejs...

got me past preset and now it's saying

$> npm run tsc

> [email protected] tsc ~/projects/shared/uif
> tsc


                                                                               
                This is not the tsc command you are looking for                
                                                                               

To get access to the TypeScript compiler, tsc, from the command line either:

- Use npm install typescript to first add TypeScript to your project before using npx
- Use yarn to avoid accidentally running code from un-installed packages
npm ERR! code ELIFECYCLE
npm ERR! errno 1

Which is peculiar. I have been running this build even yesterday and it went through without a hiccup. I'm QUITE sure Typescript is there.

EDIT: Ah. Of course. It indeed is NOT the tsc command I was looking for. I guess I can apply to stormtroopers now.

$> npm uninstall -g tsc; npm i -g typescript

@LIttleAncientForestKami
Copy link
Author

I found #928 and must say, I'm MUCH in favour. Better error message would be great to have, esp. one with a Wiki page or a GH issue link explaining the problem and some of the solutions. #914 was helpful to even make me thing of shims and re-shimming and manual edition of shim files, which led me to "no binary", which led me to installing tsc globally for my node version (which I still can't explain how I could run without this just yesterday).

@jthegedus
Copy link
Contributor

The npm registry is a fickle beast indeed!

@LIttleAncientForestKami Are you okay with me closing this since #928 already captures your desired fix and you found a resolution to your immediate problem?

@LIttleAncientForestKami
Copy link
Author

@jthegedus let me do it instead, so you don't have to open this again. And thank you again for the work on the tool. "Closing with comment" now...

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

No branches or pull requests

2 participants