当前位置:网站首页>Script import CDN link prompt net:: err_ FILE_ NOT_ Found problem

Script import CDN link prompt net:: err_ FILE_ NOT_ Found problem

2022-06-12 13:10:00 Salted fish firewood also has a big factory dream

Two days ago, I was studying Handtrack When , Found such a problem , I believe you have also encountered cdn The link of the does not work

After understanding it, I found out , This cdn It's been given to the wall for a long time , It's already deep fried , So what to do , Can't you use it ?

of couse not!


Solution

1. use npm Method to install the corresponding package to be used , Take my example

npm install --save handtrackjs

2. stay node_modules Find the directory in Find the location of the corresponding error reporting file in the package.json file , Find the corresponding version number and unpkg The address of

3. Speaking of this , Many people probably understand ,CDN no way , Then I'll replace unpkg Well , And the version can be fixed , You don't have to hang up CDN 了 , Beauty is not true , So the introduction link is changed to

<script src="https://unpkg.com/[email protected]/dist/handtrack.min.js"></script>

@ Followed by version , Directory address


The last show :

Someone must have said :“ alas ~ You all npm 了 ~ Why not directly import Import ~ You are not just looking for trouble ~”

The truth is this truth , This post is purely to provide a hard punching method , It may not be very useful , But someone will need it . Take me as an example ,handtrack use import After importing, it will not work , Or it's a mistake . therefore , Don't have to , But the idea should be !


Life is endless , Learning is more than , The keyboard is broken , The monthly salary is over ten thousand ! come on. , Code person !

原网站

版权声明
本文为[Salted fish firewood also has a big factory dream]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/163/202206121302352284.html