Skip to content

无法使用 pnpm 运行项目 #9648

@liuweiGL

Description

@liuweiGL

相关平台

微信小程序

复现仓库

https://github.com/liuweiGL/taro-pnpm
小程序基础库: any
使用框架: React

复现步骤

git clone [email protected]:liuweiGL/taro-pnpm.git

cd taro-pnpm

pnpm i

pnpm dev:weapp

期望结果

项目能正常运行

实际结果

C:\Users\liuwei\Desktop\demo\node_modules\.pnpm\resolve@1.15.1\node_modules\resolve\lib\sync.js:81
    var err = new Error("Cannot find module '"   x   "' from '"   parent   "'");
              ^

Error: Cannot find module '@tarojs/plugin-platform-weapp' from 'C:\Users\liuwei\Desktop\demo'
    at Function.resolveSync [as sync] (C:\Users\liuwei\Desktop\demo\node_modules\.pnpm\resolve@1.15.1\node_modules\resolve\lib\sync.js:81:15)
    at C:\Users\liuwei\Desktop\demo\node_modules\.pnpm\registry.nlark.com @tarojs service@3.2.13\node_modules\@tarojs\service\dist\utils\index.js:46:31
    at Array.map (<anonymous>)
    at Object.resolvePresetsOrPlugins (C:\Users\liuwei\Desktop\demo\node_modules\.pnpm\registry.nlark.com @tarojs [email protected]\node_modules\@tarojs\service\dist\utils\index.js:45:30)
    at Kernel.resolvePlugins (C:\Users\liuwei\Desktop\demo\node_modules\.pnpm\registry.nlark.com @tarojs [email protected]\node_modules\@tarojs\service\dist\Kernel.js:90:36)
    at Kernel.initPresetsAndPlugins (C:\Users\liuwei\Desktop\demo\node_modules\.pnpm\registry.nlark.com @tarojs [email protected]\node_modules\@tarojs\service\dist\Kernel.js:81:14)
    at Kernel.<anonymous> (C:\Users\liuwei\Desktop\demo\node_modules\.pnpm\registry.nlark.com @tarojs [email protected]\node_modules\@tarojs\service\dist\Kernel.js:40:18)
    at Generator.next (<anonymous>)
    at C:\Users\liuwei\Desktop\demo\node_modules\.pnpm\registry.nlark.com @tarojs [email protected]\node_modules\@tarojs\service\dist\Kernel.js:8:71
    at new Promise (<anonymous>) {
  code: 'MODULE_NOT_FOUND'
}
 ERROR  Command failed with exit code 1.

环境信息

👽 Taro v3.2.13


  Taro CLI 3.2.13 environment info:
    System:
      OS: Windows 10
    Binaries:
      Node: 16.0.0 - D:\nodejs\node.EXE
      Yarn: 1.22.10 - C:\Users\liuwei\AppData\Roaming\npm\yarn.CMD
      npm: 7.11.1 - D:\nodejs\npm.CMD

可能有用的信息

browserify/resolve#130

Metadata

Metadata

Assignees

No one assigned

    Labels

    F-reactFramework - ReactT-weappTarget - 编译到微信小程序V-3Version - 3.x

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions