vuejs / vue-cli

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

Vue UI throws error message 'cannot read properties of undefined (reading 'indexOf')' #6880

Open ghost opened 2 years ago

ghost commented 2 years ago

Version

5.0.0-rc.1

Environment info


  System:
    OS: Linux 5.4 Zorin OS 15.3
    CPU: (4) x64 Intel(R) Core(TM) i5 CPU         750  @ 2.67GHz
  Binaries:
    Node: 16.13.1 - ~/.nvm/versions/node/v16.13.1/bin/node
    Yarn: 1.22.15 - /snap/bin/yarn
    npm: 8.1.2 - ~/.nvm/versions/node/v16.13.1/bin/npm
  Browsers:
    Chrome: Not Found
    Firefox: 80.0.1
  npmGlobalPackages:
    @vue/cli: 4.5.15

Steps to reproduce

  1. Open VSCode.
  2. Type vue ui into the integrated terminal.
  3. Choose a name and npm in the first setup page.
  4. Choose default Vue 3 with Babel Preset in the next page.
  5. Proceed with your choices.

What is expected?

Vue UI creates a project.

What is actually happening?

Vue UI shows a red screen with the error message: Screenshot_2021-12-18_01-25-34

'cannot read properties of undefined (reading 'indexOf')'

This is what you see in the terminal: Screenshot_2021-12-18_01-26-11

TypeError: Cannot read properties of undefined (reading 'indexOf') at /home/zmalik/.nvm/versions/node/v16.13.1/lib/node_modules/@vue/cli/node_modules/@vue/cli-ui/apollo-server/connectors/projects.js:283:35 at processTicksAndRejections (node:internal/process/task_queues:96:5) at async Object.wrap (/home/zmalik/.nvm/versions/node/v16.13.1/lib/node_modules/@vue/cli/node_modules/@vue/cli-ui/apollo-server/connectors/progress.js:39:14)

KKKZOZ commented 2 years ago

I have the same problem,too If I toggle on the choice "CSS Pre-processors", the problem would happen image But if I toggle it off, everything goes well

vivian1223 commented 2 years ago

I have same issue too!! I've remove node modules and @vue/cli, and then install then again, still cannot solve this problem. I've also tried clean npm cache, but nothing happened :( For most important, i need sass-loader to use sass, but from the comment above, toggle off the CSS pre-processor is not a good idea for me.

node version: v16.13.2 @vue/cli version: v4.5.15

截圖 2022-02-03 下午9 17 59
KKKZOZ commented 2 years ago

I have same issue too!! I've remove node modules and @vue/cli, and then install then again, still cannot solve this problem. I've also tried clean npm cache, but nothing happened :( For most important, i need sass-loader to use sass, but from the comment above, toggle off the CSS pre-processor is not a good idea for me.

node version: v16.13.2 @vue/cli version: v4.5.15 截圖 2022-02-03 下午9 17 59

I have solved this problem but can not remeber clearly how.... Probably your project name is like "xxxxxx"(include "")? Try to change anther project name?("xxx-xxx")

vivian1223 commented 2 years ago

I have solved this problem but can not remeber clearly how.... Probably your project name is like "xxxxxx"(include "")? Try to change anther project name?("xxx-xxx")

I've tried these two ways of naming project, they both worked well before. I've finally found my issue!!! Sometimes Vue ui will auto set the package manager into yarn while i didn't install yarn before.

So i use the command :

$ npm install -g yarn

then solve the problem!