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

Question About relative path #1

Open
Lautitia opened this issue Apr 19, 2015 · 0 comments
Open

Question About relative path #1

Lautitia opened this issue Apr 19, 2015 · 0 comments

Comments

@Lautitia
Copy link

If i have the directory as following

--libs
    |- a.js
--run
    |-run.js

code in run.js

        var needless = require('needless');
        var libpath = '../libs/a';
        needless(libpath);
        require(path).callFunction(xxx)

then run run/run.js

        node run/run.js

node will report:

        Cannot find module '../libs/a'

I check the code, it seems the relative path '../libs/a' hasn't been process proper,but if i move run.js to upper level directory and modify the '../libs/a' to './libs/a' then it's ok.

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

No branches or pull requests

1 participant