npm run dev:weapp今天编译时候突然报错,报错信息如下,大神帮忙看一下是什么原因,要怎么解决



  • 👽 Taro v3.2.1

    (node:64678) UnhandledPromiseRejectionWarning: Error: Cannot find module '@tarojs/plugin-platform-weapp' from '/Users/mayli/Desktop/智数云创科技/weChart/njlm'****
    at Function.resolveSync [as sync] (/usr/local/lib/node_modules/@tarojs/cli/node_modules/resolve@1.15.1@resolve/lib/sync.js:81:15)
    at Object.keys.map.item (/usr/local/lib/node_modules/@tarojs/cli/node_modules/
    @tarojs_service@3.2.1@@tarojs/service/dist/utils/index.js:46:31)
    at Array.map (<anonymous>)
    at Object.resolvePresetsOrPlugins (/usr/local/lib/node_modules/@tarojs/cli/node_modules/@tarojs_service@3.2.1@@tarojs/service/dist/utils/index.js:45:30)
    at Kernel.resolvePlugins (/usr/local/lib/node_modules/@tarojs/cli/node_modules/
    @tarojs_service@3.2.1@@tarojs/service/dist/Kernel.js:90:36)
    at Kernel.initPresetsAndPlugins (/usr/local/lib/node_modules/@tarojs/cli/node_modules/@tarojs_service@3.2.1@@tarojs/service/dist/Kernel.js:81:14)
    at Kernel.<anonymous> (/usr/local/lib/node_modules/@tarojs/cli/node_modules/
    @tarojs_service@3.2.1@@tarojs/service/dist/Kernel.js:40:18)
    at Generator.next (<anonymous>)
    at /usr/local/lib/node_modules/@tarojs/cli/node_modules/_@tarojs_service@3.2.1@@tarojs/service/dist/Kernel.js:8:71
    at new Promise (<anonymous>)
    (node:64678) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
    (node:64678) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.粗体字

    今天突然运行项目就变成这个样子了,请问这个是什么问题导致,我搜了一下,有人说是taro版本太低了,我用的都是最新的3.0,关键是昨天醒目运行正常,今天早上一过来,项目跑起来就成这样子了,邱大神帮忙一下,谢谢



  • 应该是taro cli的版本和项目依赖的版本不一致,
    1.删除node_modules, yarn.lock, package-lock.json
    2 npm install -g @tarojs/cli
    3. taro info
    1cb6341a-3e70-466b-9f49-425494ffa708-image.png
    将依赖的版本号改到和cli版本一致
    4 npm install


登录后回复