内容简介:如果你遇到了这样的问题请不要担心,问题在于你错误的引用了npm包,并且路径可能会出现错误
如果你遇到了这样的问题
问题
jsEnginScriptError Component is not found in path "pages/index/miniprogram_npm/vant-weapp/action-sheet" (using by "pages/index/index");onAppRoute Error: Component is not found in path "pages/index/miniprogram_npm/vant-weapp/action-sheet" (using by "pages/index/index") at G (http://127.0.0.1:65059/appservice/__dev__/WAService.js:2:1526161) at G (http://127.0.0.1:65059/appservice/__dev__/WAService.js:2:1526365) at http://127.0.0.1:65059/appservice/__dev__/WAService.js:2:1547723 at Module.Ue (http://127.0.0.1:65059/appservice/__dev__/WAService.js:2:1548302) at Function.value (http://127.0.0.1:65059/appservice/__dev__/WAService.js:2:1631292) at Tt (http://127.0.0.1:65059/appservice/__dev__/WAService.js:2:1647404) at http://127.0.0.1:65059/appservice/__dev__/WAService.js:2:1651666 at xt (http://127.0.0.1:65059/appservice/__dev__/WAService.js:2:1652159) at Function.<anonymous> (http://127.0.0.1:65059/appservice/__dev__/WAService.js:2:1655744) at i.<anonymous> (http://127.0.0.1:65059/appservice/__dev__/WAService.js:2:1624244)
请不要担心,问题在于你错误的引用了npm包,并且路径可能会出现错误
解决方案
1.首先确认是否安装vant-weapp,安装步骤如下:
1.1 执行 npm init
1.2 回车到结束
1.3 npm i vant-weapp -S --production
1.4 工具->构建npm,这时你的文件目录会生成 miniprogram_npm
中文件为你所构建的Npm包
2.项目详情->使用npm(如果报错继续执行第1.4步,构建npm)
3.查看 工具->项目详情->ES6转ES5是否√选,如果没有,点击勾选
-
index.json
放组件文件中,修改引用的组件miniprogram_npm
中的内容
这里说明一点,如果你采用的是TS项目,你需要在 miniprogram
中初始化npm,执行 npm init
而非项目根目录
以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网
猜你喜欢:- 程序员有话说 | 平时的程序猿 VS 面试的程序员
- 玩转小程序转发——小程序探索
- 利用“驱动人生”升级程序的恶意程序预警
- 我是女程序员,不是程序媛
- 「小程序JAVA实战」小程序搜索功能(54)
- 程序员高薪盛宴背后:程序员正在消失?
本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
Responsive Web Design
Ethan Marcotte / Happy Cog / 2011-6 / USD 18.00
From mobile browsers to netbooks and tablets, users are visiting your sites from an increasing array of devices and browsers. Are your designs ready? Learn how to think beyond the desktop and craft be......一起来看看 《Responsive Web Design》 这本书的介绍吧!