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.
Specifically, rm yarn.lock
and then yarn install
fixed this for me.
I had that issue : use path module
const path = require('path');
and also do not forget to create the uploads directory first period.
For those running Laravel Mix with npm run watch
, just terminate the script and run the command again.
__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:
I was also plagued by this error, and after trying all the other answers, magically found the following solution:
Delete package-lock.json and the node_modules folder, then run npm install
again.
If that doesn't work, try running these in order:
npm install
npm cache clean --force
npm install -g npm
npm install
(taken from @Thisuri's answer and @Mathias Falci's comment respectively)
and then re-deleting the above files and re-running npm install
.
Worked for me!
npm install
,if the issue is not yet fixed try the following one after the other.npm cache clean
,thennpm install -g npm
,then
npm install
,Finallyng serve --o
to run the project.
Hope this will help....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!
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/
Source: Stackoverflow.com