I am trying to open a file on another folder with nodejs using an absolute path.
This file contains a js program that has to be executed the node.
I am using johnny five to program an Arduino but the file is not in the same folder as the node files and the libraries.
How can this be done?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
require('C:\\run.js')
This will get 'run.js' file from C disk. But if you already tried this, than please can you explain in more detail what you want to do?