解决小程序wepy框架运行报错问题ERR! init Make sure module "@wepy/compiler-less" is installed. If not please try "npm install @wepy/compiler-less --save-dev"

2024-07-26   阅读:183   类型:前端   分类:wepy    标签: 微信小程序

微信小程序创建wepy框架项目,运行报如下错误:

wepy build --watch

[15:55:58] ERR! init Make sure module "@wepy/compiler-less" is installed. If not please try "npm install @wepy/compiler-less --save-dev".

[15:55:58] ERR! init Can't resolve '@wepy/compiler-less' in 'F:\study\wepy\myproject1'

[15:55:58] ERR! init Make sure module "@wepy/compiler-babel" is installed. If not please try "npm install @wepy/compiler-babel --save-dev".

[15:55:58] ERR! init Can't resolve '@wepy/compiler-babel' in 'F:\study\wepy\myproject1'

[15:55:58] ERR! init Initialize failed

出现这个错误提示表明在你的项目中找不到 @wepy/compiler-less 和 @wepy/compiler-babel 这两个模块。这些模块是 Wepy 编译器所需的插件,用于处理 Less 和 Babel 相关的编译任务。

要解决这个问题,你可以按照以下步骤操作:

安装 @wepy/compiler-less 和 @wepy/compiler-babel:

打开命令提示符或终端,进入你的项目目录(即 F:\study\wepy\myproject),然后执行以下命令安装这两个模块:

npm install @wepy/compiler-less @wepy/compiler-babel --save-dev

或者使用 yarn 安装:

yarn add @wepy/compiler-less @wepy/compiler-babel --dev

重新运行构建命令:

安装完成后,再次运行 wepy build --watch 命令。

【腾讯云】2核2G云服务器新老同享 99元/年,续费同价,云服务器3年机/5年机限时抢购,低至 2.5折

‘简忆博客’微信公众号 扫码关注‘简忆博客’微信公众号,获取最新文章动态
转载:请说明文章出处“来源简忆博客”。http://tpxhm.com/fdetail/1110.html

×
觉得文章有用就打赏一下文章作者
微信扫一扫打赏 微信扫一扫打赏
支付宝扫一扫打赏 支付宝扫一扫打赏

文章评论(0)

登录
简忆博客壁纸一
简忆博客壁纸二
简忆博客壁纸三
简忆博客壁纸四
简忆博客壁纸五
简忆博客壁纸六
简忆博客壁纸七
简忆博客壁纸八
头像

简忆博客
勤于学习,乐于分享

置顶推荐

打赏本站

如果你觉得本站很棒,可以通过扫码支付打赏哦!
微信扫码:你说多少就多少~
微信扫码
支付宝扫码:你说多少就多少~
支付宝扫码
×