当前位置:网站首页>Script引入CDN链接提示net::ERR_FILE_NOT_FOUND问题
Script引入CDN链接提示net::ERR_FILE_NOT_FOUND问题
2022-06-12 13:02:00 【咸鱼柴也有大厂梦】
前两天在研究Handtrack的时候,发现了这么个问题,相信大家也有遇到过cdn的链接用不了的情况

了解了一下才发现,这个cdn早就给墙了,早就炸的透透的了,那么怎么办呢,就用不了了吗?
of couse not!
解决方案
1.用npm方法安装对应要使用的包,以我的例子为例
npm install --save handtrackjs
2.在node_modules里找目录里找到对应报错的文件的位置里面的package.json文件,找到对应的版本号以及unpkg的地址
3.说到这里,很多人大概就明白了,CDN不行,那我就平替unpkg嘛,而且版本也能固定,还省得挂CDN了,岂不美哉,所以引入链接就改为
<script src="https://unpkg.com/[email protected]/dist/handtrack.min.js"></script>
@后面接上版本,目录地址
最后说明:
肯定有人要说:“唉~你都npm了~为什么不直接import导入啊~你这不是纯纯找事干嘛~”
道理是这个道理,本帖纯属提供一个能硬冲的方法,可能没太大用,但总有人会需要的.还是以我为例,handtrack用import导入之后会用不了,要么就报错.所以,可以不用,但是思路要会!
生命不息,学习不止,键盘敲烂,月薪过万!加油,代码人!
边栏推荐
- Simple picture preview
- itk::SymmetricForcesDemonsRegistrationFilter
- 关于派文的问题
- Semantic segmentation with pytorch
- Buu question brushing record - 6
- [cloud native | kubernetes] actual combat of ingress case
- 用PyTorch进行语义分割
- Three dimensional coordinate point fitting sphere (MATLAB and C)
- 达梦数据库DM8 windows环境安装
- Structure matérielle du système embarqué - introduction du Conseil de développement embarqué basé sur arm
猜你喜欢

Constant time delete / find any element in array

VGA显示彩条和图片(FPGA)

How to balance multiple losses in deep learning?

5V升压到12.6V的锂电池充电IC芯片方案FS4062B

深度学习的多个 loss 是如何平衡的?

分享PDF高清版,系列篇

The 4th Zhejiang CTF preliminary contest web pppop

Hardware composition of embedded system - introduction of embedded development board based on ARM
![Brush questions [de1ctf 2019]shellshellshell](/img/73/00782a567e6596eb4b561b69142277.jpg)
Brush questions [de1ctf 2019]shellshellshell

实战 | 巧用位姿解算实现单目相机测距
随机推荐
Image comparison function after registration itk:: checkerboardimagefilter
成功定级腾讯T3-2,万字解析
VTK three views
看完这一篇就够了,web中文开发
itk::SymmetricForcesDemonsRegistrationFilter
Stm32f1 and stm32cubeide programming examples - device driver -eeprom-at24c256 driver
路由信息的来源
创新实训(十一)开发过程中的一些bug汇总
Semantic segmentation with pytorch
创新实训(十)高级界面美化
Actual combat | realizing monocular camera ranging by skillfully using pose solution
442 authors, 100 pages! It took Google 2 years to release the new benchmark big bench | open source
【云原生 | Kubernetes篇】深入了解Ingress
Eight misunderstandings are broken one by one (2): poor performance? Fewer applications? You worry a lot about the cloud!
leetcode 47. Permutations II 全排列 II(中等)
Detect whether the vector has an intersection
[cloud native | kubernetes] actual combat of ingress case
实战 | 巧用位姿解算实现单目相机测距
Binary tree (construction)
号称下一代监控系统!来看看它有多牛逼