ENOENT: no such file or directory for node_modules\jquery\dist\jquery.min.js'

后端 未结 1 1763
北荒
北荒 2021-02-12 10:50

I am not sure what I am doing wrong:

I am following the tutorial here, but I keep getting the following error:

ENOENT: no such file or directory,

1条回答
  •  别跟我提以往
    2021-02-12 10:57

    After reviewing my error carefully:

    C:\Users\andrewkp\Documents\VSCode\Projects\node_modules\jquery\dist\jquery.min.js'

    I noticed that I was navigating to far back, as I can see above the path it is trying to read from is totally wrong, not including my project name at all.

    The fix was to change:

    "styles": [
       "src/styles.css",
       "../node_modules/bootstrap/dist/css/bootstrap.min.css"
     ],
     "scripts": [
       "../node_modules/jquery/dist/jquery.min.js",
       "../node_modules/bootstrap/dist/js/bootstrap.min.js"
     ]
    

    To:

    "styles": [
       "src/styles.css",
       "node_modules/bootstrap/dist/css/bootstrap.min.css"
     ],
     "scripts": [
       "node_modules/jquery/dist/jquery.min.js",
       "node_modules/bootstrap/dist/js/bootstrap.min.js"
     ]
    

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