nodeJS require.paths resolve problem

后端 未结 3 1915
长发绾君心
长发绾君心 2021-02-14 20:03

I am trying to require a file relatively and mysteriously the following is happening

This works well which points to /Users/marcos/Desktop/Taper/lib/utils.js

3条回答
  •  终归单人心
    2021-02-14 21:02

    I created a new node module called rekuire.

    It allows you to "require" without using relative paths.

    It's a big time saver when it comes to testing/refactoring.

    https://npmjs.org/package/rekuire

提交回复
热议问题