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

NPM Install Fail #57

Open
AndreM222 opened this issue Oct 10, 2024 · 6 comments
Open

NPM Install Fail #57

AndreM222 opened this issue Oct 10, 2024 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@AndreM222
Copy link

Describe the bug
cant install through npm

To Reproduce
npm install -g fish-lsp

install fish-lsp globally

Screenshots
スクリーンショット 2024-10-09 21 53 44

Please complete the following information:

  • OS: MacOS
  • yarn version: 1.22.22
  • node version: v20.17.0
  • fish version: 3.7.1

Steps tried to fix.

  • updating yarn
  • reinstall typescript
  • run multiple times command
  • close and reopen terminal
@AndreM222 AndreM222 added the bug Something isn't working label Oct 10, 2024
@ndonfris
Copy link
Owner

It appears that the version you are using is out of date.

Could you try to install the latest version of the package (Possible Fix 1 Below)?

If that doesn't work, you could try the second fix, and we could continue debugging from there.


Possible Fix 1

yarn global add fish-lsp@1.0.8-1

If that doesn't work, please try the recommended installation method on the README.

git clone https://github.com/ndonfris/fish-lsp.git
cd fish-lsp
yarn install

# make sure the installation was successful
./bin/fish-lsp --version

# make sure fish-lsp got added to your path
fish-lsp --version

# if the installation was successful, but `fish-lsp` command is not found on
# your machine, try messing around with `yarn link --global fish-lsp` or
# `yarn global add fish-lsp`

Possible Fix 2

Try installing the exact node version that the package was built and tested with.

Do you have nvm installed on your machine? I think I've seen issues similar to this one, when my nvm glitches out and doesn't initialize properly. If you are familiar with nvm, I'd recommend installing the exact node version in .nvmrc.

The command to install the exact version of node is:

# https://github.com/jorgebucaran/nvm.fish
# fisher install jorgebucaran/nvm.fish
nvm install v21.7.1 && nvm use v21.7.1

this fix shouldn't be necessary. The github-actions CI/CD pipeline uses a much older version of node to test if the package installs correctly. However, its worth a shot before we continue debugging.


The upcoming version v1.0.9 of fish-lsp should hopefully fix the npm installation issues, and remove the requirement of yarn mentioned in this issue.

Unfortunately, cleaning up the codebase isn't as easy as I thought it would be, so it's taking a little longer than I anticipated. Sorry for the inconvenience. Hopefully, it will be finished in the next week or two. 🤞

Anyways, I hope this helps! If you have any other questions, feel free to ask!

@ndonfris ndonfris self-assigned this Oct 11, 2024
@ndonfris
Copy link
Owner

Next thing to try is navigating to the directory mentioned in your error message

cd /Users/andre/.nvm/versions/node/v20.17.0/lib/node_modules/fish-lsp/

Then try running the following commands:

yarn install --ignore-scripts # install the dependencies
yarn install # run the installation scripts
yarn tsc -b # make sure the project compiles
./bin/fish-lsp --help # should be working now

@AndreM222
Copy link
Author

fish-lsp@1.0.8-1

This file is not being created.

Version v20.18.0 lts/iron

スクリーンショット 2024-10-11 11 15 58

Version v21.7.1

スクリーンショット 2024-10-11 11 16 23

@ndonfris
Copy link
Owner

I'm having difficulties reproducing this bug.

I'm not sure what you mean by the file is not being created. Does the directory (that your initial screenshot showed) not have any files in it? It should contain the source code for the project, and manually running the yarn command inside there might resolve your issue.

Installing from source appears to be working perfectly fine.

As stated in the README, please clone the repo and manually build the project.

@AndreM222
Copy link
Author

AndreM222 commented Oct 16, 2024

From git clone and run yarn

image

@ndonfris
Copy link
Owner

ndonfris commented Oct 16, 2024

Okay, thanks! I still can't reproduce, unfortunately, but I've seen a similar issue occur locally before (which is actually why the previous release had the snippets/*.json entry moved into src/). I'll leave this open until we find what's causing this.

I believe the install script is failing in the screenshot shown because the fish-lsp command is still linked elsewhere and is not correctly overwriting it. While this is just my best guess, the ./scripts/build-completions.fish script directly calls the fish-lsp command (which might be linked to the npm/yarn version's you've previously tried installing). Furthermore, it looks like the project compiled successfully, which also suggests this type of issue.

  1. Start by checking if any other package manager has installed fish-lsp.
yarn global list | string match -e 'fish-lsp'

# npm ls -g 

# this might also be helpful:
# ls -la $(which fish-lsp) 

If you find the fish-lsp package in the global folder for npm/yarn/pnpm/(or any other method you tried installing on), remove and unlink the non-cloned installation globally.

  1. Check if ./bin/fish-lsp info shows any debug output. The output from the info subcommand was specifically made to help debugging these types of issues.

  2. You could also try running:

yarn install --ignore-scripts && yarn run-s setup compile sh:relink
./bin/fish-lsp complete > $fish_complete_path[1]/fish-lsp.fish

NOTE: the second line is not necessary. the next release uses the second line to build completions, so please let me know if this causes other unintended issues.

The command above is essentially running every install-script besides the one that caused the error: build-completions.fish

Hope this helps!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants