Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

packageManager设置在Windows下无效 #3811

Closed
ziyi2 opened this issue Apr 15, 2019 · 3 comments
Closed

packageManager设置在Windows下无效 #3811

ziyi2 opened this issue Apr 15, 2019 · 3 comments

Comments

@ziyi2
Copy link

ziyi2 commented Apr 15, 2019

Version

3.5.1

Reproduction link

https://github.com/ziyi2/vue-cli3-lerna-ui

Environment info

Environment Info:

  System:
    OS: Windows 10
    CPU: (8) x64 Intel(R) Xeon(R) CPU E3-1231 v3 @ 3.40GHz
  Binaries:
    Node: 10.3.0 - E:\node\node.EXE
    Yarn: 1.13.0 - C:\Users\zhuxiankang\AppData\Roaming\npm\yarn.CMD
    npm: 6.1.0 - E:\node\npm.CMD
  Browsers:
    Edge: 25.10586.672.0
  npmGlobalPackages:
    @vue/cli: 3.5.1

Steps to reproduce

1、vue create --preset ziyi2/vue-cli3-lerna-ui my-project
2、yarn serve

What is expected?

使用yarn安装依赖

What is actually happening?

使用npm安装依赖


preset.json设置如下:

{
  "useConfigFiles": true,
  "router": true,
  "routerHistoryMode": true,
  "vuex": false,
  "cssPreprocessor": "less",
  // MAC OS X下生效,Windows下不生效,具体未深入研究
  "packageManager": "yarn",
  "plugins": {
    "@vue/cli-plugin-babel": {},
    "@vue/cli-plugin-eslint": {
      "lintOn": ["save", "commit"]
    },
    "@ziyi2/vue-cli-plugin-ui-base": {},
    "@ziyi2/vue-cli-plugin-ui-cz": {},
    "@ziyi2/vue-cli-plugin-ui-lint": {}
  }
}

在MAC OS X下无此问题,但是在Windows下使用npm进行安装,由于这里采用了Monorepo结构进行设计,并使用了yarn的workspace特性,导致npm包的symlink失败,启动yarn serve时本地依赖报错。

@yrfandrew

This comment has been minimized.

@haoqunjiang

This comment has been minimized.

@haoqunjiang
Copy link
Member

packageManager 是和 preset 同级的配置。
请使用 vue create --preset ziyi2/vue-cli3-lerna-ui my-project --packageManager yarn 创建项目。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants