Skip to content

Warning from find command when use nvm run with .nvmrc #871

@dr15x86

Description

@dr15x86

If current directory have .nvmrc and you call nvm run <full_path_to_script>, nvm write to sdout: find: warning: Unix filenames usually don't contain slashes (though pathnames do).......

How check:

    mkdir /tmp/find_warn
    cd /tmp/find_warn
    echo stable > .nvmrc
    echo 'console.log("hi")' > hi.js
    nvm run /tmp/find_warn/hi.js

It print to stderr

    find: warning: Unix filenames usually don't contain slashes (though pathnames do).  That means that '-name `/tmp/find_warn/hi.js.*'' will probably evaluate to false all the time on this system.  You might find the '-wholename' test more useful, or perhaps '-samefile'.  Alternatively, if you are using GNU grep, you could use 'find ... -print0 | grep -FzZ `/tmp/find_warn/hi.js.*''.

If you call relative path nvm run hi.js all good.
but if script name start with digits (nvm run 123.js), nvm write N/A: version "v123.js" is not yet installed and exit.

May be add for nvm use and nvm run argument -- for separate node version and user command? Or special argument --use-node-version-from-nvmrc and not use heuristics for detect node version?

nvm debug:

    $SHELL: /bin/bash
    $NVM_DIR: '$HOME/.nvm'
    $PREFIX: ''
    $NPM_CONFIG_PREFIX: ''
    nvm current: v4.2.0
    which node: $NVM_DIR/versions/node/v4.2.0/bin/node
    which iojs: 
    which npm: $NVM_DIR/versions/node/v4.2.0/bin/npm
    npm config get prefix: $NVM_DIR/versions/node/v4.2.0
    npm root -g: $NVM_DIR/versions/node/v4.2.0/lib/node_modules

Distributive: Debian GNU/Linux 8.2 (jessie)

find --version: find (GNU findutils) 4.4.2

bash --version:
GNU bash, version 4.3.30(1)-release (x86_64-pc-linux-gnu)

Metadata

Metadata

Assignees

Labels

bugsOh no, something's broken :-(

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions