vuejs / vue-cli

🛠️ webpack-based tooling for Vue.js Development
https://cli.vuejs.org/
MIT License
29.76k stars 6.33k forks source link

Cannot read property 'indexOf' of undefined #5527

Open fredericrous opened 4 years ago

fredericrous commented 4 years ago

Version

4.4.1

Reproduction link

http://localhost:8000/project/create

Environment info

  System:
    OS: macOS 10.15.4
    CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
  Binaries:
    Node: 14.3.0 - /usr/local/bin/node
    Yarn: Not Found
    npm: 6.14.5 - /usr/local/bin/npm
  Browsers:
    Chrome: 81.0.4044.138
    Edge: Not Found
    Firefox: Not Found
    Safari: 13.1
  npmGlobalPackages:
    @vue/cli: 4.3.1

**I can reproduce on Node 12 as well**

Steps to reproduce

I run command vue ui, create a new project, select pnpm, manual presets, check everything but e2e, choose any css preprocessor and test framework, skip save preset

What is expected?

it's expected to create my project with pnpm. Note: pnpm is not in my global path.

What is actually happening?

It crashes

⚙️  Installing CLI plugins. This might take a while...

    at makeError (/usr/local/lib/node_modules/@vue/cli/node_modules/execa/index.js:174:9)
    at /usr/local/lib/node_modules/@vue/cli/node_modules/execa/index.js:278:16
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async /usr/local/lib/node_modules/@vue/cli/node_modules/@vue/cli-ui/apollo-server/connectors/projects.js:345:5
    at async Object.wrap (/usr/local/lib/node_modules/@vue/cli/node_modules/@vue/cli-ui/apollo-server/connectors/progress.js:39:14) {
  code: 1,
  stdout: '⚙️  Installing CLI plugins. This might take a while...\n\n',
  stderr: null,
  failed: true,
  signal: null,
  cmd: 'vue create nsembl --skipGetStarted --packageManager pnpm --force --inlinePreset {"useConfigFiles":true,"plugins":{"@vue/cli-plugin-babel":{},"@vue/cli-plugin-pwa":{},"@vue/cli-plugin-router":{"historyMode":false},"@vue/cli-plugin-vuex":{},"@vue/cli-plugin-eslint":{"config":"prettier","lintOn":["save","commit"]},"@vue/cli-plugin-unit-jest":{}},"cssPreprocessor":"stylus"}',
  timedOut: false,
  killed: false
}
TypeError: Cannot read property 'indexOf' of undefined
    at /usr/local/lib/node_modules/@vue/cli/node_modules/@vue/cli-ui/apollo-server/connectors/projects.js:274:35
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async Object.wrap (/usr/local/lib/node_modules/@vue/cli/node_modules/@vue/cli-ui/apollo-server/connectors/progress.js:39:14)
TypeError: Cannot read property 'indexOf' of undefined
    at /usr/local/lib/node_modules/@vue/cli/node_modules/@vue/cli-ui/apollo-server/connectors/projects.js:274:35
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async Object.wrap (/usr/local/lib/node_modules/@vue/cli/node_modules/@vue/cli-ui/apollo-server/connectors/progress.js:39:14)
fredericrous commented 4 years ago

My work around is to just use defaut package manager

KiranJasvanee commented 4 years ago

Vue UI concept is really cool, but I just tried to create new project using Vue UI. Kept really a simple names 'helloworldtwo', 'helloworldtwo', 'helloworld_two'.... in all cases I've received following error TypeError: Cannot read property 'indexOf' of undefined

Screenshot 2020-07-14 at 7 29 26 PM

MrChaker commented 4 years ago

Vue UI concept is really cool, but I just tried to create new project using Vue UI. Kept really a simple names 'helloworldtwo', 'helloworldtwo', 'helloworld_two'.... in all cases I've received following error TypeError: Cannot read property 'indexOf' of undefined

Screenshot 2020-07-14 at 7 29 26 PM

Did u solver it bro ? if u did tell us how please .

yx-yangxiao commented 3 years ago

maybe you can download the 4.5.9 data of vue/cli?