Chaunjie / kai-ui

高颜值组件库,简单易用,同时支持原生和wepy框架
https://chaunjie.github.io/kui/dist
215 stars 33 forks source link

拷贝库到本地安装完依赖运行会出现包缺少问题 #20

Closed luo-geng closed 5 years ago

luo-geng commented 5 years ago

运行run dev。 警告内容如下:Error: Cannot find module 'less'[WARNING] 找不到编译器:wepy-compiler-less

Chaunjie commented 5 years ago

@luogeng2017 你应该是wepy框架依赖的wepy-compiler-less模块未安装,先安装了下该模块

luo-geng commented 5 years ago

@Chaunjie 安装了,但是还是报错

Chaunjie commented 5 years ago

@luogeng2017 你试着删除项目node_modules然后执行npm i

luo-geng commented 5 years ago

还是不行。

arning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
[1/4] Resolving packages...
[2/4] Fetching packages...
info fsevents@1.2.4: The platform "win32" is incompatible with this module.
info "fsevents@1.2.4" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning " > babel-jest@23.6.0" has unmet peer dependency "babel-core@^6.0.0 || ^7.0.0-0".
warning " > wepy-compiler-less@1.3.14" has unmet peer dependency "less@^3.8.1".
[4/4] Building fresh packages...
Done in 38.42s.

d:\miniapp\kai-ui>yarn dev
yarn run v1.10.1
$ wepy build --watch
d:\miniapp\
{ Error: Cannot find module 'less'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:580:15)
    at Function.Module._load (internal/modules/cjs/loader.js:506:25)
    at Module.require (internal/modules/cjs/loader.js:636:17)
    at require (internal/modules/cjs/helpers.js:20:18)
    at Object.<anonymous> (d:\miniapp\kai-ui\node_modules\wepy-compiler-less\lib\index.js:20:13)
    at Module._compile (internal/modules/cjs/loader.js:688:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)
    at Module.load (internal/modules/cjs/loader.js:598:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
    at Function.Module._load (internal/modules/cjs/loader.js:529:3)
    at Module.require (internal/modules/cjs/loader.js:636:17)
    at require (internal/modules/cjs/helpers.js:20:18)
    at Object.load (C:\Users\Administrator\AppData\Local\Yarn\Data\global\node_modules\wepy-cli\lib\loader.js:113:17)
    at Object.loadCompiler (C:\Users\Administrator\AppData\Local\Yarn\Data\global\node_modules\wepy-cli\lib\loader.js:69:29)
    at Object.checkCompiler (C:\Users\Administrator\AppData\Local\Yarn\Data\global\node_modules\wepy-cli\lib\compile.js:178:35)
    at Object.init (C:\Users\Administrator\AppData\Local\Yarn\Data\global\node_modules\wepy-cli\lib\compile.js:221:19) code: 'MODULE_NOT_FOUND' }
[WARNING] 找不到编译器:wepy-compiler-less。
[18:44:36] [信息] 检测到有效NPM包资源,正在尝试安装,请稍等。
Chaunjie commented 5 years ago

安装less模块

luo-geng commented 5 years ago

@Chaunjie 嗯,之前没看清楚。只看到后面那。你把那个包也加到package.json里

Chaunjie commented 5 years ago

好的