ENOENT, no such file or directory

前端 未结 10 1906
萌比男神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:02

    I had that issue : use path module

    const path = require('path');
    

    and also do not forget to create the uploads directory first period.

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

    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!

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

    Specifically, rm yarn.lock and then yarn install fixed this for me.

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

    Tilde expansion is a shell thing. Write the proper pathname (probably /home/yourusername/Desktop/etcetcetc) or use
    process.env.HOME + '/Desktop/blahblahblah'

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

    I believe the previous answer is the correct answer to this problem but I was getting this error when I tried installing npm package (see below) :

    The fix for me was : npm init --yes

    0 讨论(0)
  • 2020-12-05 00:09
    1. First try npm install ,if the issue is not yet fixed try the following one after the other.
    2. npm cache clean ,then
    3. npm install -g npm,then npm install,Finally
    4. ng serve --o to run the project. Hope this will help....
    0 讨论(0)
提交回复
热议问题