ENOENT: no such file or directory, open '/dist/index.html'
See original GitHub issue- I’m submitting a …
- [x ] bug report
- [ ] feature request
- [ ] support request => Please do not submit a support request here, see note at the top of this template.
I was following one of the examples, and after running “node dist/server.js”, I’m getting this error
fs.js:646
return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
^
Error: ENOENT: no such file or directory, open '/dist/index.html'
index.html exists in the dist folder
- Please tell us about your environment:
- Angular version: 5.2.9
- OS: [ Mac OS X ]
Issue Analytics
- State:
- Created 5 years ago
- Comments:12
Top Results From Across the Web
Error: ENOENT: no such file or directory, open 'dist/index.html'
You incorrectly set the distFolder variable. The distFolder from server.ts must point to the files containing the client side app, ...
Read more >Error: ENOENT: no such file or directory, open 'dist/index.html'
I am using Angular 9 and at a stage where I am thinking of dropping the idea of using angular universal at all....
Read more >no such file or directory, stat '/public/main.html' at Error (native ...
HTML : Error: ENOENT : no such file or directory, stat '/public/main. html ' at Error (native) [ Gift : Animated Search Engine ......
Read more >express error: enoent: no such file or directory, stat - You.com
I suspect that index.html was not copied to the output directory from where your code resolves the absolute path for res.sendFile(...) .
Read more >Error: ENOENT: no such file or directory, stat '/opt/render ...
If you're not using our free tier, you can use the shell tab to look at the filesystem of what you've deployed to...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
i replace this line:
const template = fs.readFileSync(path.join(__dirname, ‘.’, ‘dist’, ‘index.html’)).toString();
And works for me 😄
const template = fs.readFileSync(path.join(__dirname, join(DIST_FOLDER, ‘browser/index.html’))).toString();
I applied this
and my error changed to this fs.js:114 throw err; ^
Error: ENOENT: no such file or directory, open ‘\C:\Users\Bilal Khalid\Desktop\Practice Codes\universal\dist\browser\index.html’