Giter Site home page Giter Site logo

Allow custom node and npm paths about tabby HOT 31 CLOSED

eugeny avatar eugeny commented on August 24, 2024 11
Allow custom node and npm paths

from tabby.

Comments (31)

equinusocio avatar equinusocio commented on August 24, 2024 3

Same issue with npm installed with brew

from tabby.

mikesprague avatar mikesprague commented on August 24, 2024 2

Same issue here on Sierra with v1.0.0-alpha.18 (re-re-fixed custom npm path detection).

This definitely appears to be Mac specific. I have Terminus installed on 2 Linux boxes and they pick up npm and allow plugin installation correctly.

from tabby.

compuguy avatar compuguy commented on August 24, 2024 1

@Eugeny Automatic npm detection is broken for me on my Mac. Using npm provided by homebrew. The manual npm config option wasn't working on that either. A Ubuntu machine I use has no problems with automatic npm detection, though.

from tabby.

rhamzeh avatar rhamzeh commented on August 24, 2024 1

Both automatic and manual detection are still broken on Alpha 35 (I'm using nvm)

However, it did work once I manually symlinked npm and node to /usr/bin/npm and /usr/bin/node

**
OS: Ubuntu 16.04
Node: 8.4.0

**
Current config:

    terminal:
      bell: 'off'
      shell: /bin/bash
    hotkeys: {}
    appearance:
      tabsLocation: top
      dock: 'off'
      frame: full
    npm: /home/raghd/programs/nvm/versions/node/v8.4.0/bin/npm

from tabby.

jporter-dev avatar jporter-dev commented on August 24, 2024 1

Not working for me on alpha 68.

from tabby.

Eugeny avatar Eugeny commented on August 24, 2024

You can specify the path to npm through the npm option on the top level of config file

from tabby.

sergiopvilar avatar sergiopvilar commented on August 24, 2024

Does not work for me.

❯ which npm
/Users/sergio/.nvm/versions/node/v6.9.1/bin/npm
terminal:
  font: Hack
  shell: /bin/zsh
  background: theme
hotkeys: {}
appearance:
  frame: full
  tabsLocation: top
npm: /Users/sergio/.nvm/versions/node/v6.9.1/bin/npm

from tabby.

Eugeny avatar Eugeny commented on August 24, 2024

Could you please retry with Alpha 18?

from tabby.

sergiopvilar avatar sergiopvilar commented on August 24, 2024

The same

same

from tabby.

Eugeny avatar Eugeny commented on August 24, 2024

Does npm exit with code 0 if you run it as /Users/sergio/.nvm/versions/node/v6.9.1/bin/npm -v ?

from tabby.

sergiopvilar avatar sergiopvilar commented on August 24, 2024

@Eugeny Yes it does:

❯ /Users/sergio/.nvm/versions/node/v6.9.1/bin/npm -v
3.10.8

rpm git/mr-2845-fix-serial-retrieval-url
❯ echo $?
0

from tabby.

compuguy avatar compuguy commented on August 24, 2024

Issue is still present on alpha 21, on OSX.

Same with alpha 22. Related to #4

from tabby.

compuguy avatar compuguy commented on August 24, 2024

Issue is still present with the latest alpha (28).

from tabby.

ClementParis016 avatar ClementParis016 commented on August 24, 2024

I'm having the same issue on alpha 29 using NVM

from tabby.

compuguy avatar compuguy commented on August 24, 2024

Alpha 30, 31 and 32 still have this issue (on macos).

from tabby.

Eugeny avatar Eugeny commented on August 24, 2024

@compuguy @ClementParis016 do you mean the automatic NPM detection or the npm config option?

from tabby.

ClementParis016 avatar ClementParis016 commented on August 24, 2024

@Eugeny I was talking about the automatic detection. Though, auto-detection works well on my personal Windows machine with NVM for Windows but it doesn't on my Ubuntu work laptop having NVM. It's may be due to the way they differ on handling the linking of npm & Node executable for the active version.

from tabby.

dloret avatar dloret commented on August 24, 2024

Version: 1.0.0-alpha.27
Platform: win32 10.0.15063

In the plugin menu, I see the message 'NPM is not installed':
npm

It is in fact installed in Ubuntu in Windows 10, as I use the bash terminal with Visual Studio Code. Due to other bugs, I had to chose between the Windows installation of NodeJS and NPM, or the Linux installation.

I also added "npm: /usr/bin/npm" in the config.yaml file located in %APPDATA%/Terminus. But it didn't have any effect.

If other people are in the same case, it would perhaps be interesting to address this also ?

Many thanks in advance.
Donatien

from tabby.

Eugeny avatar Eugeny commented on August 24, 2024

Could you guys please retest this with the latest alpha? I've added some improvements for the node & npm search paths there. Thanks!

from tabby.

rhamzeh avatar rhamzeh commented on August 24, 2024

@Eugeny Just tried it, it is no longer showing npm not installed, but the app is hanging as soon as I click on plugins.

OS: Ubuntu Linux
OS Version: 18.04
Node Version: 8.11.1
Terminus Version: Alpha 46 (tar.gz file) retrieved from Github Downloads

screenshot from 2018-05-15 11-32-18

from tabby.

Eugeny avatar Eugeny commented on August 24, 2024

@rhamzeh any idea why the terminal says Stopped?

from tabby.

rhamzeh avatar rhamzeh commented on August 24, 2024

@Eugeny No sorry, it prints that as soon as I click on "Plugins" :/

from tabby.

RobertDeRose avatar RobertDeRose commented on August 24, 2024

I'm using Windows Subsystem for Linux, and I've used the following value

wsl /usr/bin/npm

which seems to work, plugins are listed, Terminus reports that npm is installed, except that when I attempt to install plugins, everything appears to work, no errors, yet after a restart, nothing was installed.

There are no error logs either.

I noticed when I clicked on the "Plugins Folder" button in the up right corner, that Windows explore said the folder did not exists, so I created, but still nothing is installed. I opened the DevTools, but nothing is logged to the console and no errors appear on the console.

using latest Alpha 62

from tabby.

Eugeny avatar Eugeny commented on August 24, 2024

Robert, on Windows, Terminus requires a win32 NodeJS build with NPM to install plugins. The reason is that the plugin directory is outside of WSL rootfs and that windows-specific package versions should be installed (as opposed to Linux ones that WSL-based NPM would install).

from tabby.

RobertDeRose avatar RobertDeRose commented on August 24, 2024

That makes sense. Was hoping to not need to install multiple nodejs on the machine.

from tabby.

Spaxe avatar Spaxe commented on August 24, 2024

Retested with alpha 67, auto npm detection with homebrew installed npm (symlinked at /usr/local/bin/npm) doesn't work. EDIT: clarification, it's on my $PATH, and still not working.

from tabby.

MircoT avatar MircoT commented on August 24, 2024

I have the same issue with macOS 10.14.2 and I installed both, Terminus and node with npm using homebrew. With the debugger, I found that the research in PATH is a little bit ambiguous. The PATH variable is not the same in these two points:

https://github.com/Eugeny/terminus/blob/1a258f32b05c66a476ed9668e62ac9de92ea88f7/terminus-plugin-manager/src/services/pluginManager.service.ts#L51

https://github.com/Eugeny/terminus/blob/1a258f32b05c66a476ed9668e62ac9de92ea88f7/terminus-plugin-manager/src/services/pluginManager.service.ts#L46

Probably when it asks for the PATH environment with the current user shell exec('$SHELL -i -c \'echo $PATH\'' something is going bad. But, with this tip I figure out that the script open the user shell and due to this it will expand all user environment. For this reason the PATH I added in my .zshrc config file are present.

So, to fix the problem I simply add the npm and node paths to my .zshrc file like that:

export PATH="/usr/local/bin:$PATH"

Hope this will be helpful.

PS: Of course, the configuration file depends on your shell.

from tabby.

peterlobster avatar peterlobster commented on August 24, 2024

I'm using Alpha 69 asdf and npm is installed /Users/$USER/.asdf/shims; which is correctly set up in the $PATH...

$ echo $PATH
/Users/peter/.asdf/shims:/usr/local/opt/asdf/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/MacGPG2/bin 
$ ls /Users/peter/.asdf/shims
node npm  npx

$ npm

Usage: npm <command>

where <command> is one of:
    access, adduser, audit, bin, bugs, c, cache, ci, cit,
    completion, config, create, ddp, dedupe, deprecate,
    dist-tag, docs, doctor, edit, explore, get, help,
    help-search, hook, i, init, install, install-test, it, link,
    list, ln, login, logout, ls, outdated, owner, pack, ping,
    prefix, profile, prune, publish, rb, rebuild, repo, restart,
    root, run, run-script, s, se, search, set, shrinkwrap, star,
    stars, start, stop, t, team, test, token, tst, un,
    uninstall, unpublish, unstar, up, update, v, version, view,
    whoami

npm <command> -h  quick help on <command>
npm -l            display full usage info
npm help <term>   search for help on <term>
npm help npm      involved overview

Specify configs in the ini-formatted file:
    /Users/peter/.npmrc
or on the command line via: npm <command> --key value
Config info can be viewed via: npm help config

[email protected] /Users/peter/.asdf/installs/nodejs/10.15.0/lib/node_modules/npm

I've specficed the path in my config but still no cigar...

npm: /Users/peter/.asdf/installs/nodejs/10.15.0/lib/node_modules/npm/bin/npm
hotkeys:
  shell: {}
ssh: {}
terminal:
  colorScheme:
    name: Dracula
    foreground: '#f8f8f2'
    background: '#1e1f29'
    cursor: '#bbbbbb'
    colors:
      - '#000000'
      - '#ff5555'
      - '#50fa7b'
      - '#f1fa8c'
      - '#bd93f9'
      - '#ff79c6'
      - '#8be9fd'
      - '#bbbbbb'
      - '#555555'
      - '#ff5555'
      - '#50fa7b'
      - '#f1fa8c'
      - '#bd93f9'
      - '#ff79c6'
      - '#8be9fd'
      - '#ffffff'
  ligatures: true
  background: colorScheme
  environment: {}
  bell: audible
  autoOpen: false
  frontend: hterm
  profiles:
    - name: Headmaster (Lando) - Pantheon
      sessionOptions:
        command: /usr/local/bin/bash
        args:
          - '--login'
        env: {}
        cwd: /Volumes/Scratch/Code/*/website
appearance:
  theme: Standard
  vibrancy: true
  frame: thin
  dock: 'off'
  dockFill: 0.75
pluginBlacklist: []

tried this too...

npm: /Users/peter/.asdf/shims/npm
hotkeys:
  shell: {}
ssh: {}
terminal:
  colorScheme:
    name: Dracula
    foreground: '#f8f8f2'
    background: '#1e1f29'
    cursor: '#bbbbbb'
    colors:
      - '#000000'
      - '#ff5555'
      - '#50fa7b'
      - '#f1fa8c'
      - '#bd93f9'
      - '#ff79c6'
      - '#8be9fd'
      - '#bbbbbb'
      - '#555555'
      - '#ff5555'
      - '#50fa7b'
      - '#f1fa8c'
      - '#bd93f9'
      - '#ff79c6'
      - '#8be9fd'
      - '#ffffff'
  ligatures: true
  background: colorScheme
  environment: {}
  bell: audible
  autoOpen: false
  frontend: hterm
  profiles:
    - name: Headmaster (Lando) - Pantheon
      sessionOptions:
        command: /usr/local/bin/bash
        args:
          - '--login'
        env: {}
        cwd: /Volumes/Scratch/Code/*/website
appearance:
  theme: Standard
  vibrancy: true
  frame: thin
  dock: 'off'
  dockFill: 0.75
pluginBlacklist: []
$ ls .asdf/installs/nodejs/10.15.0/lib/node_modules/npm/bin/
node-gyp-bin npm          npm-cli.js   npm.cmd      npx          npx-cli.js   npx.cmd

I still get...
screen shot 2019-01-27 at 3 48 35 pm
screen shot 2019-01-27 at 3 49 31 pm

from tabby.

peterlobster avatar peterlobster commented on August 24, 2024

Maybe this has something to do with it? @Eugeny

screen shot 2019-01-27 at 11 29 45 pm
screen shot 2019-01-27 at 11 30 48 pm

from tabby.

peterlobster avatar peterlobster commented on August 24, 2024

@Eugeny I saw you closed this in 59d1a2f, but I'm still getting the error in 1.0.71. Is there something I'm (we're) supposed to be doing differently to make this work? Thanks for your great effort! 👍

from tabby.

Eugeny avatar Eugeny commented on August 24, 2024

@peterlobster it's not a part of any release yet, but you can grab a nightly build

from tabby.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.