Jquery not working in angular 6 Error: ENOENT: no such file or directory, open '…\node_modules\jquery\dist\jquery.min.js'

前端 未结 11 1709
离开以前
离开以前 2021-02-01 02:02

I am in process migrating Angular 5 project to Angular 6.

While starting application by

npm start

getting the below error



        
11条回答
  •  难免孤独
    2021-02-01 02:38

    In Angular 6 u don't need to write:

    "../node_modules/jquery/dist/jquery.js",
    "../node_modules/tether/dist/js/tether.js",
    "../node_modules/bootstrap/dist/js/bootstrap.js"
    

    You can write with ./ like on the top this will works too, but the easiest way in angular.json file:

    "node_modules/jquery/dist/jquery.js",
    "node_modules/tether/dist/js/tether.js",
    "node_modules/bootstrap/dist/js/bootstrap.js"
    

    In my opinion it's better and clear

提交回复
热议问题