ENOENT,没有这样的文件或目录 [英] ENOENT, no such file or directory
本文介绍了ENOENT,没有这样的文件或目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
ENOENT,没有这样的文件或目录'〜/ Desktop / MyApp / newversion / partials / navigation.jade'
我知道文件在那里,因为当我尝试使用精确复制和粘贴的路径打开文件,它的工作原理。
我也知道应用程序正在使用正确的目录,因为它输出错误。
解决方案
波浪形膨胀是一种壳体。编写正确的路径名(可能 / home /
yourusername / Desktop / etcetcetc
)或使用
process.env.HOME +'/ Desktop / blahblahblah'
I'm getting this error from my node app:
ENOENT, no such file or directory '~/Desktop/MyApp/newversion/partials/navigation.jade'
I know the file is there because when I try to open the file using the exact copied and pasted path, it works. I also know the application is using the right directory because, well, it outputs it in the error.
解决方案
Tilde expansion is a shell thing. Write the proper pathname (probably /home/
yourusername/Desktop/etcetcetc
) or use
process.env.HOME + '/Desktop/blahblahblah'
这篇关于ENOENT,没有这样的文件或目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文