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

The "path" argument must be of type string. Received type undefined #160

Closed
m-janiszewski opened this issue Apr 20, 2020 · 3 comments · Fixed by #168
Closed

The "path" argument must be of type string. Received type undefined #160

m-janiszewski opened this issue Apr 20, 2020 · 3 comments · Fixed by #168

Comments

@m-janiszewski
Copy link

Hi,

I'm executing following steps to install nvs on Docker image with ubuntu 18.04LTS

export NVS_HOME="$HOME/.nvs"
git clone https://github.com/jasongin/nvs "$NVS_HOME"
. "$NVS_HOME/nvs.sh" install

The last command ends up with an error:

The "path" argument must be of type string. Received type undefined

Should I update any config file to make it work?

@jasongin
Copy link
Owner

Hmm, I haven't seen this before, and I don't know exactly where that error is coming from. Can you set this variable before the install step?

export NVS_DEBUG=1

Then it should print a stack trace with the error, that will hopefully pinpoint the problem.

@m-janiszewski
Copy link
Author

. "$NVS_HOME/nvs.sh" install
TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received type undefined
    at assertPath (path.js:39:11)
    at Object.basename (path.js:1297:5)
    at getShellProfile (/root/.nvs/lib/install.js:97:23)
    at Object.install (/root/.nvs/lib/install.js:40:21)
    at doCommand (/root/.nvs/lib/main.js:90:32)
    at main (/root/.nvs/lib/main.js:21:12)
    at Object.<anonymous> (/root/.nvs/lib/main.js:16:1)
    at Module._compile (internal/modules/cjs/loader.js:688:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)
    at Module.load (internal/modules/cjs/loader.js:598:32)

@jasongin
Copy link
Owner

Ahh, so the problem is a missing SHELL environment variable. Normally that would be set to the path to your preferred shell, e.g. /bin/bash.

The install process tries to detect the user's preferred shell so it can choose to add nvs to either .bashrc or .zshrc or .profile. But probably it should skip that step (and print a warning) if the SHELL environment variable is not set, or is set to some unknown shell.

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

Successfully merging a pull request may close this issue.

2 participants