vercel / hyper

A terminal built on web technologies
https://hyper.is
MIT License
42.98k stars 3.47k forks source link

Latest Hyper.app with nvm doesnt find node #3688

Open felixgeelhaar opened 5 years ago

felixgeelhaar commented 5 years ago

Hi there,

Issue

I use nvm with the latest node installed. After installing hyper, I get the error: env: node: No such file or directory

which node works with version: v12.3.1 Skimming through the issues wasn't successful.

Any pieces of advice? Screenshot 2019-05-23 at 21 26 32

felixgeelhaar commented 5 years ago

Screenshot 2019-05-23 at 21 40 00

dmohns commented 5 years ago

Not sure if this is the right direction, but do you have a system node version? E.g. what is the output of

nvm use system
which node

?

felixgeelhaar commented 5 years ago

Hey @dmohns, nope I don't have a system node. I just use nvm.

So even if I have a system node and use it, the message of the missing node is not shown anymore, but the plugins are even not applied to the term.

Screenshot 2019-05-24 at 20 36 30 Screenshot 2019-05-24 at 20 36 55 Screenshot 2019-05-24 at 20 37 56

dmohns commented 5 years ago

Did you add the theme to your .hyper.js 😉 ?

felixgeelhaar commented 5 years ago

yep, did it and found that the plugins were not installed through hyper i. After installing those via npm it worked out. I'll further investigate and check what's going on.

janapc commented 3 years ago

I have the same problem 😞

WeaponizedLego commented 2 years ago

yep, did it and found that the plugins were not installed through hyper i. After installing those via npm it worked out. I'll further investigate and check what's going @on.

did you @FelixGeelhaar discover anything on this? I've encountered the exact same problem, except that I am on version 3.1.5 of hyper

LabhanshAgrawal commented 2 years ago

@WeaponizedLego we don't need node to install plugins now, we use electron itself as node can you paste the output from hyper -v (from any other terminal) when this happens and from the dev console (ctrl+shift+i) along with your config (ctrl+, or cmd+,)

WeaponizedLego commented 2 years ago

@LabhanshAgrawal I'm not sure if you wanted me to paste the export but here it is

➜  ~ hyper -v
Plugin error while loading "hyper-pmndrs" (/Users/glen/.hyper_plugins/node_modules/hyper-pmndrs): Cannot find module '/Users/glen/.hyper_plugins/node_modules/hyper-pmndrs'
Require stack:
- /Applications/Hyper.app/Contents/Resources/app.asar/plugins.js
- /Applications/Hyper.app/Contents/Resources/app.asar/index.js
- 

Plugin error while loading "hyperpower" (/Users/glen/.hyper_plugins/node_modules/hyperpower): Cannot find module '/Users/glen/.hyper_plugins/node_modules/hyperpower'
Require stack:
- /Applications/Hyper.app/Contents/Resources/app.asar/plugins.js
- /Applications/Hyper.app/Contents/Resources/app.asar/index.js
- 

plugins have changed / not init, scheduling plugins installation

Disabling Chromium GPU blacklist

running in prod mode
electron will open file:///Applications/Hyper.app/Contents/Resources/app.asar/index.html

(node:35035) electron: The default of nativeWindowOpen is deprecated and will be changing from false to true in Electron 15.  See https://github.com/electron/electron/issues/28511 for more information.
(Use `Hyper --trace-warnings ...` to show where the warning was created)

Hyper CLI already in PATH

Hyper CLI installed Symlink created at /usr/local/bin/hyper undefined

[35035:0128/172922.273522:INFO:CONSOLE(1)] "(re)loading renderer plugins", source: file:///Applications/Hyper.app/Contents/Resources/app.asar/renderer/bundle.js (1)

[35035:0128/172922.327703:INFO:CONSOLE(36)] "total init time 84", source: file:///Applications/Hyper.app/Contents/Resources/app.asar/index.html (36)

Checking for notification messages

No matching notification messages

Launching yarn: /Applications/Hyper.app/Contents/MacOS/Hyper /Applications/Hyper.app/Contents/Resources/bin/yarn-standalone.js install --no-emoji --no-lockfile --cache-folder /Users/glen/.hyper_plugins/cache

[Notification] Error updating plugins.: env: node: No such file or directory

env: node: No such file or directory

image of that other thing

LabhanshAgrawal commented 2 years ago

@WeaponizedLego I meant dev console output from Hyper along with it's config

WeaponizedLego commented 2 years ago

@LabhanshAgrawal config here:

"use strict";
// Future versions of Hyper may add additional config options,
// which will not automatically be merged into this file.
// See https://hyper.is#cfg for all currently supported options.
module.exports = {
    config: {
        // choose either `'stable'` for receiving highly polished,
        // or `'canary'` for less polished but more frequent updates
        updateChannel: 'stable',
        // default font size in pixels for all tabs
        fontSize: 12,
        // font family with optional fallbacks
        fontFamily: 'Menlo, "DejaVu Sans Mono", Consolas, "Lucida Console", monospace',
        // default font weight: 'normal' or 'bold'
        fontWeight: 'normal',
        // font weight for bold characters: 'normal' or 'bold'
        fontWeightBold: 'bold',
        // line height as a relative unit
        lineHeight: 1,
        // letter spacing as a relative unit
        letterSpacing: 0,
        // terminal cursor background color and opacity (hex, rgb, hsl, hsv, hwb or cmyk)
        cursorColor: 'rgba(248,28,229,0.8)',
        // terminal text color under BLOCK cursor
        cursorAccentColor: '#000',
        // `'BEAM'` for |, `'UNDERLINE'` for _, `'BLOCK'` for â–ˆ
        cursorShape: 'BLOCK',
        // set to `true` (without backticks and without quotes) for blinking cursor
        cursorBlink: false,
        // color of the text
        foregroundColor: '#fff',
        // terminal background color
        // opacity is only supported on macOS
        backgroundColor: '#000',
        // terminal selection color
        selectionColor: 'rgba(248,28,229,0.3)',
        // border color (window, tabs)
        borderColor: '#333',
        // custom CSS to embed in the main window
        css: '',
        // custom CSS to embed in the terminal window
        termCSS: '',
        // set custom startup directory (must be an absolute path)
        workingDirectory: '',
        // if you're using a Linux setup which show native menus, set to false
        // default: `true` on Linux, `true` on Windows, ignored on macOS
        showHamburgerMenu: '',
        // set to `false` (without backticks and without quotes) if you want to hide the minimize, maximize and close buttons
        // additionally, set to `'left'` if you want them on the left, like in Ubuntu
        // default: `true` (without backticks and without quotes) on Windows and Linux, ignored on macOS
        showWindowControls: '',
        // custom padding (CSS format, i.e.: `top right bottom left`)
        padding: '12px 14px',
        // the full list. if you're going to provide the full color palette,
        // including the 6 x 6 color cubes and the grayscale map, just provide
        // an array here instead of a color map object
        colors: {
            black: '#000000',
            red: '#C51E14',
            green: '#1DC121',
            yellow: '#C7C329',
            blue: '#0A2FC4',
            magenta: '#C839C5',
            cyan: '#20C5C6',
            white: '#C7C7C7',
            lightBlack: '#686868',
            lightRed: '#FD6F6B',
            lightGreen: '#67F86F',
            lightYellow: '#FFFA72',
            lightBlue: '#6A76FB',
            lightMagenta: '#FD7CFC',
            lightCyan: '#68FDFE',
            lightWhite: '#FFFFFF',
            limeGreen: '#32CD32',
            lightCoral: '#F08080',
        },
        // the shell to run when spawning a new session (i.e. /usr/local/bin/fish)
        // if left empty, your system's login shell will be used by default
        //
        // Windows
        // - Make sure to use a full path if the binary name doesn't work
        // - Remove `--login` in shellArgs
        //
        // Windows Subsystem for Linux (WSL) - previously Bash on Windows
        // - Example: `C:\\Windows\\System32\\wsl.exe`
        //
        // Git-bash on Windows
        // - Example: `C:\\Program Files\\Git\\bin\\bash.exe`
        //
        // PowerShell on Windows
        // - Example: `C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`
        //
        // Cygwin
        // - Example: `C:\\cygwin64\\bin\\bash.exe`
        shell: '',
        // for setting shell arguments (i.e. for using interactive shellArgs: `['-i']`)
        // by default `['--login']` will be used
        shellArgs: ['--login'],
        // for environment variables
        env: {
        },
        // Supported Options:
        //  1. 'SOUND' -> Enables the bell as a sound
        //  2. false: turns off the bell
        bell: 'SOUND',
        // An absolute file path to a sound file on the machine.
        // bellSoundURL: '/path/to/sound/file',
        // if `true` (without backticks and without quotes), selected text will automatically be copied to the clipboard
        copyOnSelect: false,
        // if `true` (without backticks and without quotes), hyper will be set as the default protocol client for SSH
        defaultSSHApp: true,
        // if `true` (without backticks and without quotes), on right click selected text will be copied or pasted if no
        // selection is present (`true` by default on Windows and disables the context menu feature)
        quickEdit: false,
        // choose either `'vertical'`, if you want the column mode when Option key is hold during selection (Default)
        // or `'force'`, if you want to force selection regardless of whether the terminal is in mouse events mode
        // (inside tmux or vim with mouse mode enabled for example).
        macOptionSelectionMode: 'vertical',
        // Whether to use the WebGL renderer. Set it to false to use canvas-based
        // rendering (slower, but supports transparent backgrounds)
        webGLRenderer: true,
        // keypress required for weblink activation: [ctrl|alt|meta|shift]
        // todo: does not pick up config changes automatically, need to restart terminal :/
        webLinksActivationKey: '',
        // if `false` (without backticks and without quotes), Hyper will use ligatures provided by some fonts
        disableLigatures: true,
        // set to true to disable auto updates
        disableAutoUpdates: false,
        // set to true to enable screen reading apps (like NVDA) to read the contents of the terminal
        screenReaderMode: false,
        // for advanced config flags please refer to https://hyper.is/#cfg
    },
    // a list of plugins to fetch and install from npm
    // format: [@org/]project[#version]
    // examples:
    //   `hyperpower`
    //   `@company/project`
    //   `project#1.0.1`
    plugins: ["hyper-pmndrs", "hyperpower"],
    // in development, you can create a directory under
    // `~/.hyper_plugins/local/` and include it here
    // to load it and avoid it being `npm install`ed
    localPlugins: [],
    keymaps: {
    // Example
    // 'window:devtools': 'cmd+alt+o',
    },
};
//# sourceMappingURL=config-default.js.map

The output from terminal as well as the stuff it printed when I opened config

Plugin error while loading "hyper-pmndrs" (/Users/glen/.hyper_plugins/node_modules/hyper-pmndrs): Cannot find module '/Users/glen/.hyper_plugins/node_modules/hyper-pmndrs'
Require stack:
- /Applications/Hyper.app/Contents/Resources/app.asar/plugins.js
- /Applications/Hyper.app/Contents/Resources/app.asar/index.js
- 

Plugin error while loading "hyperpower" (/Users/glen/.hyper_plugins/node_modules/hyperpower): Cannot find module '/Users/glen/.hyper_plugins/node_modules/hyperpower'
Require stack:
- /Applications/Hyper.app/Contents/Resources/app.asar/plugins.js
- /Applications/Hyper.app/Contents/Resources/app.asar/index.js
- 

plugins have changed / not init, scheduling plugins installation

Disabling Chromium GPU blacklist

running in prod mode
electron will open file:///Applications/Hyper.app/Contents/Resources/app.asar/index.html

(node:38890) electron: The default of nativeWindowOpen is deprecated and will be changing from false to true in Electron 15.  See https://github.com/electron/electron/issues/28511 for more information.
(Use `Hyper --trace-warnings ...` to show where the warning was created)

Hyper CLI already in PATH

Hyper CLI installed Symlink created at /usr/local/bin/hyper undefined

[38890:0128/192737.266126:INFO:CONSOLE(1)] "(re)loading renderer plugins", source: file:///Applications/Hyper.app/Contents/Resources/app.asar/renderer/bundle.js (1)

[38890:0128/192737.319831:INFO:CONSOLE(36)] "total init time 82.60000002384186", source: file:///Applications/Hyper.app/Contents/Resources/app.asar/index.html (36)

Checking for notification messages

No matching notification messages

Launching yarn: /Applications/Hyper.app/Contents/MacOS/Hyper /Applications/Hyper.app/Contents/Resources/bin/yarn-standalone.js install --no-emoji --no-lockfile --cache-folder /Users/glen/.hyper_plugins/cache

[Notification] Error updating plugins.: env: node: No such file or directory

env: node: No such file or directory

[Notification] Configuration updated: Hyper configuration reloaded!
felixgeelhaar commented 2 years ago

Hey there,

I figured out for me it was a mix up of Homebrew node path and nvm path. When deleting node via Homebrew the node cli was gone too.

After configuring the nvm path in $PATH it was able to install stuff as expected.

On 28. Jan 2022, at 19:30, WeaponizedLego @.***> wrote:

 @LabhanshAgrawal config here:

"use strict"; // Future versions of Hyper may add additional config options, // which will not automatically be merged into this file. // See https://hyper.is#cfg for all currently supported options. module.exports = { config: { // choose either 'stable' for receiving highly polished, // or 'canary' for less polished but more frequent updates updateChannel: 'stable', // default font size in pixels for all tabs fontSize: 12, // font family with optional fallbacks fontFamily: 'Menlo, "DejaVu Sans Mono", Consolas, "Lucida Console", monospace', // default font weight: 'normal' or 'bold' fontWeight: 'normal', // font weight for bold characters: 'normal' or 'bold' fontWeightBold: 'bold', // line height as a relative unit lineHeight: 1, // letter spacing as a relative unit letterSpacing: 0, // terminal cursor background color and opacity (hex, rgb, hsl, hsv, hwb or cmyk) cursorColor: 'rgba(248,28,229,0.8)', // terminal text color under BLOCK cursor cursorAccentColor: '#000', // 'BEAM' for |, 'UNDERLINE' for _, 'BLOCK' for â–ˆ cursorShape: 'BLOCK', // set to true (without backticks and without quotes) for blinking cursor cursorBlink: false, // color of the text foregroundColor: '#fff', // terminal background color // opacity is only supported on macOS backgroundColor: '#000', // terminal selection color selectionColor: 'rgba(248,28,229,0.3)', // border color (window, tabs) borderColor: '#333', // custom CSS to embed in the main window css: '', // custom CSS to embed in the terminal window termCSS: '', // set custom startup directory (must be an absolute path) workingDirectory: '', // if you're using a Linux setup which show native menus, set to false // default: true on Linux, true on Windows, ignored on macOS showHamburgerMenu: '', // set to false (without backticks and without quotes) if you want to hide the minimize, maximize and close buttons // additionally, set to 'left' if you want them on the left, like in Ubuntu // default: true (without backticks and without quotes) on Windows and Linux, ignored on macOS showWindowControls: '', // custom padding (CSS format, i.e.: top right bottom left) padding: '12px 14px', // the full list. if you're going to provide the full color palette, // including the 6 x 6 color cubes and the grayscale map, just provide // an array here instead of a color map object colors: { black: '#000000', red: '#C51E14', green: '#1DC121', yellow: '#C7C329', blue: '#0A2FC4', magenta: '#C839C5', cyan: '#20C5C6', white: '#C7C7C7', lightBlack: '#686868', lightRed: '#FD6F6B', lightGreen: '#67F86F', lightYellow: '#FFFA72', lightBlue: '#6A76FB', lightMagenta: '#FD7CFC', lightCyan: '#68FDFE', lightWhite: '#FFFFFF', limeGreen: '#32CD32', lightCoral: '#F08080', }, // the shell to run when spawning a new session (i.e. /usr/local/bin/fish) // if left empty, your system's login shell will be used by default // // Windows // - Make sure to use a full path if the binary name doesn't work // - Remove --login in shellArgs // // Windows Subsystem for Linux (WSL) - previously Bash on Windows // - Example: C:\\Windows\\System32\\wsl.exe // // Git-bash on Windows // - Example: C:\\Program Files\\Git\\bin\\bash.exe // // PowerShell on Windows // - Example: C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\powershell.exe // // Cygwin // - Example: C:\\cygwin64\\bin\\bash.exe shell: '', // for setting shell arguments (i.e. for using interactive shellArgs: ['-i']) // by default ['--login'] will be used shellArgs: ['--login'], // for environment variables env: { }, // Supported Options: // 1. 'SOUND' -> Enables the bell as a sound // 2. false: turns off the bell bell: 'SOUND', // An absolute file path to a sound file on the machine. // bellSoundURL: '/path/to/sound/file', // if true (without backticks and without quotes), selected text will automatically be copied to the clipboard copyOnSelect: false, // if true (without backticks and without quotes), hyper will be set as the default protocol client for SSH defaultSSHApp: true, // if true (without backticks and without quotes), on right click selected text will be copied or pasted if no // selection is present (true by default on Windows and disables the context menu feature) quickEdit: false, // choose either 'vertical', if you want the column mode when Option key is hold during selection (Default) // or 'force', if you want to force selection regardless of whether the terminal is in mouse events mode // (inside tmux or vim with mouse mode enabled for example). macOptionSelectionMode: 'vertical', // Whether to use the WebGL renderer. Set it to false to use canvas-based // rendering (slower, but supports transparent backgrounds) webGLRenderer: true, // keypress required for weblink activation: [ctrl|alt|meta|shift] // todo: does not pick up config changes automatically, need to restart terminal :/ webLinksActivationKey: '', // if false (without backticks and without quotes), Hyper will use ligatures provided by some fonts disableLigatures: true, // set to true to disable auto updates disableAutoUpdates: false, // set to true to enable screen reading apps (like NVDA) to read the contents of the terminal screenReaderMode: false, // for advanced config flags please refer to https://hyper.is/#cfg }, // a list of plugins to fetch and install from npm // format: @./]project[#version] // examples: // hyperpower // @./project //project#1.0.1 plugins: ["hyper-pmndrs", "hyperpower"], // in development, you can create a directory under //~/.hyper_plugins/local/and include it here // to load it and avoid it beingnpm install`ed localPlugins: [], keymaps: { // Example // 'window:devtools': 'cmd+alt+o', }, }; //# sourceMappingURL=config-default.js.map The output from terminal as well as the stuff it printed when I opened config

Plugin error while loading "hyper-pmndrs" (/Users/glen/.hyper_plugins/node_modules/hyper-pmndrs): Cannot find module '/Users/glen/.hyper_plugins/node_modules/hyper-pmndrs' Require stack:

  • /Applications/Hyper.app/Contents/Resources/app.asar/plugins.js
  • /Applications/Hyper.app/Contents/Resources/app.asar/index.js

Plugin error while loading "hyperpower" (/Users/glen/.hyper_plugins/node_modules/hyperpower): Cannot find module '/Users/glen/.hyper_plugins/node_modules/hyperpower' Require stack:

  • /Applications/Hyper.app/Contents/Resources/app.asar/plugins.js
  • /Applications/Hyper.app/Contents/Resources/app.asar/index.js

plugins have changed / not init, scheduling plugins installation

Disabling Chromium GPU blacklist

running in prod mode electron will open file:///Applications/Hyper.app/Contents/Resources/app.asar/index.html

(node:38890) electron: The default of nativeWindowOpen is deprecated and will be changing from false to true in Electron 15. See https://github.com/electron/electron/issues/28511 for more information. (Use Hyper --trace-warnings ... to show where the warning was created)

Hyper CLI already in PATH

Hyper CLI installed Symlink created at /usr/local/bin/hyper undefined

[38890:0128/192737.266126:INFO:CONSOLE(1)] "(re)loading renderer plugins", source: file:///Applications/Hyper.app/Contents/Resources/app.asar/renderer/bundle.js (1)

[38890:0128/192737.319831:INFO:CONSOLE(36)] "total init time 82.60000002384186", source: file:///Applications/Hyper.app/Contents/Resources/app.asar/index.html (36)

Checking for notification messages

No matching notification messages

Launching yarn: /Applications/Hyper.app/Contents/MacOS/Hyper /Applications/Hyper.app/Contents/Resources/bin/yarn-standalone.js install --no-emoji --no-lockfile --cache-folder /Users/glen/.hyper_plugins/cache

[Notification] Error updating plugins.: env: node: No such file or directory

env: node: No such file or directory

[Notification] Configuration updated: Hyper configuration reloaded! — Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you were mentioned.

WeaponizedLego commented 2 years ago

@FelixGeelhaar I know I'm asking for a lot of hand holding here, but could you elaborate on how you add to the paths on a mac?

I have these few lines at the bottom om my .zshrc file but that doesn't seem to work

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"  # This loads nvm bash_completion
LabhanshAgrawal commented 2 years ago

@WeaponizedLego can you try once after removing the 1st line from /Applications/Hyper.app/Contents/Resources/bin/yarn-standalone.js the one having #!/usr/bin/env node

WeaponizedLego commented 2 years ago

@WeaponizedLego can you try once after removing the 1st line from /Applications/Hyper.app/Contents/Resources/bin/yarn-standalone.js the one having #!/usr/bin/env node

That didn't seem to change much :(

LabhanshAgrawal commented 2 years ago

After removing that line did you quit hyper and restart? If not, can you try that too.

WeaponizedLego commented 2 years ago

After removing that line did you quit hyper and restart? If not, can you try that too.

I did, also rebooted the mac for good measure.

LabhanshAgrawal commented 2 years ago

I've even tried after uninstalling node, it worked even then. Not really able to think of anywhere else which references env node Let's try running the command manually. cd to ~/.hyper_plugins and then

NODE_ENV=production ELECTRON_RUN_AS_NODE=true /Applications/Hyper.app/Contents/MacOS/Hyper /Applications/Hyper.app/Contents/Resources/bin/yarn-standalone.js install --no-emoji --no-lockfile --cache-folder ~/.hyper_plugins/cache
WeaponizedLego commented 2 years ago

I've even tried after uninstalling node, it worked even then. Not really able to think of anywhere else which references env node Let's try running the command manually. cd to ~/.hyper_plugins and then

NODE_ENV=production ELECTRON_RUN_AS_NODE=true /Applications/Hyper.app/Contents/MacOS/Hyper /Applications/Hyper.app/Contents/Resources/bin/yarn-standalone.js install --no-emoji --no-lockfile --cache-folder ~/.hyper_plugins/cache

Alright, I tried that. But that command couldn't execute.

But I did go further with this. It still says the original error that it cannot find the node env... But adding yarnrc.yml to ~/.hyper_plugins with the line nodeLinker: node-modules it allowed me to install the plugins with yarn. and have them load. I'm uncertain if this is the intended behaviour when doing so. I'm using yarn 3 if that matters at all in this context.

LabhanshAgrawal commented 2 years ago

it shouldn't give that error if node is installed (you can confirm with /usr/bin/env node) We ship yarn 1.x with hyper and run that using the node mode from electron. It should still load, since yarn 3 will also install the plugin modules. Not able to think any other way for now, might revisit later.

calebwaldner commented 3 months ago

I'm also having an issue with node. Getting error env: node: No such file or directory. I use NVM for node (when I type which node I get /Users/calebwaldner/.nvm/versions/node/v20.9.0/bin/node).

If there is some sort of update to $PATH that I need to make, please let me know.