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

4.0.1“vue ui” - Error in creating new project and installing Vue-cli on another computer #4692

Closed
ahong18s opened this issue Oct 17, 2019 · 18 comments · Fixed by #4698
Closed

Comments

@ahong18s
Copy link

Version

4.0.1

Environment info

 System:
   OS: Windows 7
   CPU: (4) x64 Intel(R) Core(TM) i3-7100 CPU @ 3.90GH
 Binaries:
   Node: 12.10.0 - C:\Program Files\nodejs\node.EXE
   Yarn: Not Found
   npm: 6.10.3 - C:\Program Files\nodejs\npm.CMD
 npmPackages:
   @vue/babel-helper-vue-jsx-merge-props:  1.0.0
   @vue/babel-plugin-transform-vue-jsx:  1.0.0
   @vue/babel-preset-app:  4.0.0
   @vue/babel-preset-jsx:  1.1.1
   @vue/babel-sugar-functional-vue:  1.0.0
   @vue/babel-sugar-inject-h:  1.0.0
   @vue/babel-sugar-v-model:  1.1.1
   @vue/babel-sugar-v-on:  1.1.0
   @vue/cli-overlay:  4.0.0
   @vue/cli-plugin-babel: ^4.0.0 => 4.0.0
   @vue/cli-plugin-eslint: ^4.0.0 => 4.0.1
   @vue/cli-service: ^4.0.0 => 4.0.0
   @vue/cli-shared-utils:  4.0.0
   @vue/component-compiler-utils:  3.0.0
   @vue/preload-webpack-plugin:  1.1.1
   @vue/web-component-wrapper:  1.2.0
   eslint-plugin-vue: ^5.0.0 => 5.2.3
   vue: ^2.6.10 => 2.6.10
   vue-eslint-parser:  5.0.0
   vue-hot-reload-api:  2.3.4
   vue-loader:  15.7.1
   vue-router: ^3.1.3 => 3.1.3
   vue-style-loader:  4.1.2
   vue-template-compiler: ^2.6.10 => 2.6.10
   vue-template-es2015-compiler:  1.9.1
 npmGlobalPackages:
   @vue/cli: Not Found

Steps to reproduce

1.Unload and empty Vue
2.Install Vue-cli
3.Create a new project using "vue ui"
4.If you can continue, select the "Vue router" button in the "plugin" menu.

What is expected?

Create and run projects

What is actually happening?

failed


Wrong information:
� Starting GUI...
� Ready on http://localhost:8000
removed 1 package in 31.525s
TypeError: apply is not a function
at C:\Users*\AppData\Roaming\nvm\v12.10.0\node_modules@vue\cli\lib\Gener
ator.js:103:7
at Array.forEach ()
at new Generator (C:\Users*\AppData\Roaming\nvm\v12.10.0\node_modules@vu
e\cli\lib\Generator.js:101:13)
at Function.runGenerator (C:\Users*\AppData\Roaming\nvm\v12.10.0\node_mod
ules@vue\cli\lib\invoke.js:123:21)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async install (C:\Users*\AppData\Roaming\nvm\v12.10.0\node_modules@vu
e\cli\node_modules@vue\cli-ui\ui-defaults\suggestions.js:82:5)
at async Object.handler (C:\Users*\AppData\Roaming\nvm\v12.10.0\node_modu
les@vue\cli\node_modules@vue\cli-ui\ui-defaults\suggestions.js:32:13)
at async Object.activate (C:\Users*\AppData\Roaming\nvm\v12.10.0\node_mod
ules@vue\cli\node_modules@vue\cli-ui\apollo-server\connectors\suggestions.js:8
2:14)

Wrong information:
� Starting GUI...
� Ready on http://localhost:8000
ERROR Error: Cannot resolve plugin router from package.json. Did you forget to
install it?
Error: Cannot resolve plugin router from package.json. Did you forget to install
it?
at invoke (C:\Users*\AppData\Roaming\nvm\v12.10.0\node_modules@vue\cli\l
ib\invoke.js:58:11)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async install (C:\Users*\AppData\Roaming\nvm\v12.10.0\node_modules@vu
e\cli\node_modules@vue\cli-ui\ui-defaults\suggestions.js:80:5)
at async Object.handler (C:\Users*\AppData\Roaming\nvm\v12.10.0\node_modu
les@vue\cli\node_modules@vue\cli-ui\ui-defaults\suggestions.js:18:13)
at async Object.activate (C:\Users*\AppData\Roaming\nvm\v12.10.0\node_mod
ules@vue\cli\node_modules@vue\cli-ui\apollo-server\connectors\suggestions.js:8
2:14)

@Mu-tou
Copy link

Mu-tou commented Oct 17, 2019

vue-cli 4.0.1 构建时 也出现以上bug

@ahong18s
Copy link
Author

vue-cli 4.0.1 构建时 也出现以上bug

来了 (゚▽゚*)
家用笔记本Windows10专业版,昨晚新安装node+vue直接不能启动ㄟ( ▔, ▔ )ㄏ

@Mu-tou
Copy link

Mu-tou commented Oct 17, 2019 via email

@ahong18s
Copy link
Author

你是 哪个国家的 vue同学?

------------------ 原始邮件 ------------------ 发件人: "playfulhd"notifications@github.com; 发送时间: 2019年10月17日(星期四) 上午10:16 收件人: "vuejs/vue-cli"vue-cli@noreply.github.com; 抄送: "愚木头"2676171993@qq.com; "Comment"comment@noreply.github.com; 主题: Re: [vuejs/vue-cli] 4.0.1“vue ui” - Error in creating new project and installing Vue-cli on another computer (#4692) vue-cli 4.0.1 构建时 也出现以上bug 来了 (゚▽゚*) 家用笔记本Windows10专业版,昨晚新安装node+vue直接不能启动ㄟ( ▔, ▔ )ㄏ — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

来自中国,使用汉语

@ahong18s ahong18s reopened this Oct 17, 2019
@sodatea
Copy link
Member

sodatea commented Oct 17, 2019

Fixed in 4.0.2

@sodatea sodatea closed this as completed Oct 17, 2019
@Mu-tou
Copy link

Mu-tou commented Oct 17, 2019

我是在 vue add vuex 出现的同上问题

@Mu-tou
Copy link

Mu-tou commented Oct 17, 2019

还有个问题 在vue create project 时, 所选定的router vuex 在构建后package 里 并未呈现 ,也没有安装的迹象

@ahong18s
Copy link
Author

我是在 vue add vuex 出现的同上问题

看评论官方回复了,刚更新了4.0.2,但是我测试没成功!
正在重新配置和安装,你也试试?
还有,这条issue被关闭了,如果还是报错我就再开启

@Mu-tou
Copy link

Mu-tou commented Oct 17, 2019

好的 稍等

@sodatea
Copy link
Member

sodatea commented Oct 17, 2019

直接在3.x的旧项目里点右上角按钮运行好像还是有问题,先升级项目或者先用命令行吧

@sodatea sodatea reopened this Oct 17, 2019
@ahong18s
Copy link
Author

ahong18s commented Oct 17, 2019

vue create project

还有个问题 在vue create project 时, 所选定的router vuex 在构建后package 里 并未呈现 ,也没有安装的迹象

我刚试了你说的——vue create project 选择预设时,选中vue-router和vuex进行安装
结果:构建后代码正常
猜测:选择后还有保存改动的选项,你是否正确配置?选项都是英文的,我也看不懂,自行翻译或者百度吧
更新:刚更新后,router.js从根目录移动到router文件夹下自动配置
原先都是手动改位置,这个很方便

@Mu-tou
Copy link

Mu-tou commented Oct 17, 2019

4.0.2 可以了,正常 ,感觉 分文件,更友好了。多谢多谢

@ahong18s
Copy link
Author

4.0.2 可以了,正常 ,感觉 分文件,更友好了。多谢多谢

好了就OK,我还在测试着...
支持Vue!

@ahong18s
Copy link
Author

ahong18s commented Oct 17, 2019

直接在3.x的旧项目里点右上角按钮运行好像还是有问题,先升级项目或者先用命令行吧

正常使用了,感谢!! (*´v`)
我又尝试了一遍预设,“默认预设”还是一样的问题

  • 版本:4.0.2
  • 过程:全部新建项目
  • 命令:vue ui
  1. installui:正常;
  2. 默认:依旧存在问题,点击安装按钮(vue-router和vuex)出现第二个“Wrong information”的报错信息
    建议隐藏预设,如果不再需要;
  3. 手动:正常。

@ahong18s
Copy link
Author

ahong18s commented Oct 17, 2019

直接在3.x的旧项目里点右上角按钮运行好像还是有问题,先升级项目或者先用命令行吧

我看到升级到4.0.3了,能够正常创建项目了!
另外,我测试了一些其他情况:
版本:4.0.3
Node:10.16.3
过程:

  1. 使用“vue ui”创建“默认预设”的项目,选择“vue-router”的按钮之后:
  • 必须刷新页面才会加载“插件列表”,对比以前是自动加载;
  • 安装后,在package和package-lock里新添了"vue-router": "^3.0.6"
  • 但是,此项目不存在此插件,不能使用;
  1. 最终我发现了原因,并且我猜测这可能是新版本的特性!
    原因:在DOS窗口里,必须手动确认加载vue-router之后才是完整的步骤。
    DOS:

� Installing @vue/cli-plugin-router...

  • @vue/cli-plugin-router@4.0.3
    updated 1 package in 7.476s
    ✔ Successfully installed plugin: @vue/cli-plugin-router

? Use history mode for router? (Requires proper server setup for index fallback in production)

YES

� Invoking generator for @vue/cli-plugin-router...
� Installing additional dependencies...

added 1 package from 1 contributor in 8.392s
⚓ Running completion hooks...

✔ Successfully invoked generator for plugin: @vue/cli-plugin-router
The following files have been updated / added:

 src/router/index.js
 src/views/About.vue
 src/views/Home.vue
 package-lock.json
 package.json
 src/App.vue
 src/main.js

You should review these changes with git diff and commit them.

  1. 安装vue-router成功,不但自动生成router文件,而且可以正常使用!接下来
    接下来选择vuex按钮,是一次就成功了!

其他:
启动vue ui,切换菜单到“创建项目”,每次都是在C盘目录下?对比以前:记录上一次的目录。

如果以上是新版本的特性,请忽略我的建议!
最后,辛苦大大们了!(^o^)/~

@sodatea
Copy link
Member

sodatea commented Oct 17, 2019

原因:在DOS窗口里,必须手动确认加载vue-router之后才是完整的步骤。

😂这是 bug

启动vue ui,切换菜单到“创建项目”,每次都是在C盘目录下?对比以前:记录上一次的目录。

没主动动过这块代码,在 Mac 下也没发现问题,我晚上再用 Windows 看看……

@ahong18s
Copy link
Author

ahong18s commented Oct 17, 2019

原因:在DOS窗口里,必须手动确认加载vue-router之后才是完整的步骤。

这是 bug

启动vue ui,切换菜单到“创建项目”,每次都是在C盘目录下?对比以前:记录上一次的目录。

没主动动过这块代码,在 Mac 下也没发现问题,我晚上再用 Windows 看看……

经过对比,我发现了:在不同电脑上的环境(node+vue)相同,但是“vue ui”的预设选项不一样!

  1. Windows10(专业版)
  • node,10.16.3
  • @vue/cli, 4.0.3
  • 区别,重新搭建的node,安装@vue/cli
  • 区别,vue ui的预设只有3个,没有最新的installui
  • 另外,当安装@vue/cli后多了很多行的提示,类似“加入我们等等”,之前没有的提示。
    node postinstall || echo "ignore"
    (如果需要我提供此全部的提示,需要等到7点下班后了)
    (并且,我也想尝试在命令行下创建项目,观察有没有installui预设)
  1. Windows7(专业版)
  • node,10.16.3,也尝试了12.10.0
  • @vue/cli, 4.0.3
  • 区别,旧版本升级
  • 区别,vue ui的预设有4个
  • 并且,切换到12.10.0环境后没有出现上面(Windows10)提到的情况。

最后,昨天我提出的

启动vue ui,切换菜单到“创建项目”,每次都是在C盘目录下?对比以前:记录上一次的目录。

经尝试,是没有问题的!(可能是需要重启电脑或者是浏览器的一些行为导致)

@DrunkLife
Copy link

vue ui 插件和依赖中的最新版本全是0.1.0,4.0.2、4.0.3都是

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

Successfully merging a pull request may close this issue.

4 participants