天易
天易
  • 发布:2022-04-23 14:38
  • 更新:2023-07-06 16:44
  • 阅读:367

【报Bug】使用 pnpm 管理依赖发现 build 命令失效,无法启动 dev-server

分类:uni-app

产品分类: uniapp/H5

PC开发环境操作系统: Windows

PC开发环境操作系统版本号: Windows 10 专业版 19043.1266

浏览器平台: Chrome

浏览器版本: Microsoft Edge 94.0.992.38

项目创建方式: CLI

CLI版本号: 2.0.1-34720220422001

示例代码:
// vue.config.js  

module.exports = {  
  chainWebpack: (config) => {  
    // symlinks  
    config.resolve.symlinks = false  
  },  
.......  
}
$ pnpm run info  

> h5-welfare@0.1.0 info E:\WorkSpace\h5-welfare  
> node node_modules/@dcloudio/vue-cli-plugin-uni/commands/info.js  

uni-app v3.4.7  
uni-app cli v2.0.1-34720220422001  

Environment Info:  

  System:  
    OS: Windows 10  
    CPU: (4) x64 Intel(R) Core(TM) i5-7300HQ CPU @ 2.50GHz  
  Binaries:  
    Node: 16.14.2 - D:\Develop\nodejs\node.EXE  
    Yarn: Not Found  
    npm: 8.5.0 - D:\Develop\nodejs\npm.CMD  
  Browsers:  
    Edge: 44.19041.1266.0  
  npmPackages:  
    @dcloudio/types: * => 2.6.4  
    @dcloudio/uni-app-plus: ^2.0.1-34720220422001 => 2.0.1-34720220422001  
    @dcloudio/uni-automator: ^2.0.1-34720220422001 => 2.0.1-34720220422001  
    @dcloudio/uni-cli-i18n: ^2.0.1-34620220419001 => 2.0.1-34620220419001  
    @dcloudio/uni-cli-shared: ^2.0.1-34720220422001 => 2.0.1-34720220422001  
    @dcloudio/uni-h5: ^2.0.1-34720220422001 => 2.0.1-34720220422001  
    @dcloudio/uni-helper-json: * => 1.0.13  
    @dcloudio/uni-migration: ^2.0.1-34720220422001 => 2.0.1-34720220422001  
    @dcloudio/uni-mp-360: ^2.0.1-34720220422001 => 2.0.1-34720220422001  
    @dcloudio/uni-mp-alipay: ^2.0.1-34720220422001 => 2.0.1-34720220422001  
    @dcloudio/uni-mp-baidu: ^2.0.1-34720220422001 => 2.0.1-34720220422001  
    @dcloudio/uni-mp-qq: ^2.0.1-34720220422001 => 2.0.1-34720220422001  
    @dcloudio/uni-mp-toutiao: ^2.0.1-34720220422001 => 2.0.1-34720220422001  
    @dcloudio/uni-mp-vue: ^2.0.1-34720220422001 => 2.0.1-alpha-34620220415002  
    @dcloudio/uni-mp-weixin: ^2.0.1-34720220422001 => 2.0.1-34720220422001  
    @dcloudio/uni-quickapp-native: ^2.0.1-34720220422001 => 2.0.1-alpha-34620220415002  
    @dcloudio/uni-quickapp-webview: ^2.0.1-34720220422001 => 2.0.1-34720220422001  
    @dcloudio/uni-stat: ^2.0.1-34720220422001 => 2.0.1-34720220422001  
    @dcloudio/uni-template-compiler: ^2.0.1-34720220422001 => 2.0.1-34720220422001  
    @dcloudio/vue-cli-plugin-hbuilderx: ^2.0.1-34720220422001 => 2.0.1-34720220422001  
    @dcloudio/vue-cli-plugin-uni: ^2.0.1-34720220422001 => 2.0.1-34720220422001  
    @dcloudio/vue-cli-plugin-uni-optimize: ^2.0.1-34720220422001 => 2.0.1-34720220422001  
    @dcloudio/webpack-uni-mp-loader: ^2.0.1-34720220422001 => 2.0.1-34720220422001  
    @dcloudio/webpack-uni-pages-loader: ^2.0.1-34720220422001 => 2.0.1-34720220422001  
    @hap-toolkit/dsl-vue:  0.6.13  
    @vue/babel-helper-vue-jsx-merge-props:  1.2.1  
    @vue/babel-helper-vue-transform-on:  1.0.2  
    @vue/babel-plugin-jsx:  1.1.1  
    @vue/babel-plugin-transform-vue-jsx:  1.2.1  
    @vue/babel-preset-app:  4.5.17  
    @vue/babel-preset-jsx:  1.2.4  
    @vue/babel-sugar-composition-api-inject-h:  1.2.1  
    @vue/babel-sugar-composition-api-render-instance:  1.2.4  
    @vue/babel-sugar-functional-vue:  1.2.2  
    @vue/babel-sugar-inject-h:  1.2.2  
    @vue/babel-sugar-v-model:  1.2.3  
    @vue/babel-sugar-v-on:  1.2.3  
    @vue/cli-overlay:  4.5.17  
    @vue/cli-plugin-babel: ~4.5.0 => 4.5.17  
    @vue/cli-plugin-router:  4.5.17  
    @vue/cli-plugin-vuex:  4.5.17  
    @vue/cli-service: ~4.5.0 => 4.5.17  
    @vue/cli-shared-utils:  4.5.17  
    @vue/component-compiler-utils:  3.3.0  
    @vue/preload-webpack-plugin:  1.1.2  
    @vue/shared: ^3.0.0-rc.4 => 3.2.33  
    @vue/web-component-wrapper:  1.3.0  
    vue: ^2.6.11 => 2.6.14  
    vue-clipboard2: ^0.3.1 => 0.3.3  
    vue-hot-reload-api:  2.3.4  
    vue-lazyload: ^1.3.3 => 1.3.3  
    vue-loader:  15.9.8 (15.9.8)  
    vue-router: ^3.4.3 => 3.5.3  
    vue-style-loader:  4.1.3  
    vue-template-compiler: ^2.6.11 => 2.6.14  
    vue-template-es2015-compiler:  1.9.1  
    vuex: ^3.2.0 => 3.6.2  
  npmGlobalPackages:  
    @vue/cli: Not Found

操作步骤:

$ pnpm dev

预期结果:

正常启动 dev-server

实际结果:
Hyman@T470P MINGW64 /e/WorkSpace/h5-welfare (master)  
$ pnpm dev  

> h5-welfare@0.1.0 dev E:\WorkSpace\h5-welfare  
> cross-env NODE_ENV=development UNI_PLATFORM=h5 vue-cli-service uni-serve  

请注意运行模式下,因日志输出、sourcemap以及未压缩源码等原因,性能和包体积,均不及发行模式。  

Hyman@T470P MINGW64 /e/WorkSpace/h5-welfare (master)  
$  

Hyman@T470P MINGW64 /e/WorkSpace/h5-welfare (master)  
$

bug描述:

执行 pnmp dev 无法正常启动 dev-server

2022-04-23 14:38 负责人:无 分享
已邀请:
r***@163.com

r***@163.com - 11111

请问解决了吗?

要回复问题请先登录注册