ENOENT, no such file or directory

前端 未结 10 1907
萌比男神i
萌比男神i 2020-12-04 23:39

I\'m getting this error from my node app:

ENOENT, no such file or directory \'~/Desktop/MyApp/newversion/partials/navigation.jade\'

I know

相关标签:
10条回答
  • 2020-12-05 00:13
    __dirname 
    

    Gives you the current node application's rooth directory.

    In your case, you'd use

    __dirname + '/Desktop/MyApp/newversion/partials/navigation.jade';
    

    See this answer:

    App base path from a module in NodeJS

    0 讨论(0)
  • 2020-12-05 00:18

    Another possibility is that you are missing an .npmrc file if you are pulling any packages that are not publicly available.

    You will need to add an .npmrc file at the root directory and add the private/internal registry inside of the .npmrc file like this:

    registry=http://private.package.source/secret/npm-packages/
    
    0 讨论(0)
  • 2020-12-05 00:21

    For me, it was having my code folder in Dropbox on windows 10. During the build process Dropbox would flip out over having more than 500,000 files. I moved my folder out and now it builds fine!

    0 讨论(0)
  • 2020-12-05 00:24

    For those running Laravel Mix with npm run watch, just terminate the script and run the command again.

    0 讨论(0)
提交回复
热议问题