Команда 'vue' не найдена Ubuntu 18.04 - PullRequest
0 голосов
/ 08 февраля 2020

У меня уже установлено глобальное nodejs v10.19.0.

Сначала у меня npm (как в моей ветке с проектом, так и на root):

valentin@valentin:~$ npm i -g @vue/cli
npm WARN deprecated core-js@2.6.11: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
npm WARN rm not removing /home/valentin/.npm-global/bin/vue as it wasn't installed by /home/valentin/.npm-global/lib/node_modules/@vue/cli
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.11 (node_modules/@vue/cli/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.11: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

npm ERR! code EEXIST
npm ERR! syscall symlink
npm ERR! path ../lib/node_modules/@vue/cli/bin/vue.js
npm ERR! dest /home/valentin/.npm-global/bin/vue
npm ERR! errno -17
npm ERR! EEXIST: file already exists, symlink '../lib/node_modules/@vue/cli/bin/vue.js' -> '/home/valentin/.npm-global/bin/vue'
npm ERR! File exists: /home/valentin/.npm-global/bin/vue
npm ERR! Remove the existing file and try again, or run npm
npm ERR! with --force to overwrite files recklessly.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/valentin/.npm/_logs/2020-02-08T10_36_35_054Z-debug.log
valentin@valentin:~$ npm i -g @vue/cli --force
npm WARN using --force I sure hope you know what you are doing.
npm WARN deprecated core-js@2.6.11: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
/home/valentin/.npm-global/bin/vue -> /home/valentin/.npm-global/lib/node_modules/@vue/cli/bin/vue.js

> fsevents@1.2.11 install /home/valentin/.npm-global/lib/node_modules/@vue/cli/node_modules/fsevents
> node-gyp rebuild

make: Entering directory '/home/valentin/.npm-global/lib/node_modules/@vue/cli/node_modules/fsevents/build'
  SOLINK_MODULE(target) Release/obj.target/.node
  COPY Release/.node
make: Leaving directory '/home/valentin/.npm-global/lib/node_modules/@vue/cli/node_modules/fsevents/build'

> core-js@2.6.11 postinstall /home/valentin/.npm-global/lib/node_modules/@vue/cli/node_modules/babel-polyfill/node_modules/core-js
> node -e "try{require('./postinstall')}catch(e){}"

Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!

The project needs your help! Please consider supporting of core-js on Open Collective or Patreon: 
> https://opencollective.com/core-js 
> https://www.patreon.com/zloirock 

Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)


> core-js@2.6.11 postinstall /home/valentin/.npm-global/lib/node_modules/@vue/cli/node_modules/babel-runtime/node_modules/core-js
> node -e "try{require('./postinstall')}catch(e){}"


> core-js@3.6.4 postinstall /home/valentin/.npm-global/lib/node_modules/@vue/cli/node_modules/core-js
> node -e "try{require('./postinstall')}catch(e){}"


> @apollo/protobufjs@1.0.3 postinstall /home/valentin/.npm-global/lib/node_modules/@vue/cli/node_modules/@apollo/protobufjs
> node scripts/postinstall


> nodemon@1.19.4 postinstall /home/valentin/.npm-global/lib/node_modules/@vue/cli/node_modules/nodemon
> node bin/postinstall || exit 0


> ejs@2.7.4 postinstall /home/valentin/.npm-global/lib/node_modules/@vue/cli/node_modules/ejs
> node ./postinstall.js

Thank you for installing EJS: built with the Jake JavaScript build tool (https://jakejs.com/)

+ @vue/cli@4.2.2
added 1178 packages from 661 contributors in 40.25s
valentin@valentin:~$ vue --version

Command 'vue' not found, did you mean:

  command 'vpe' from deb texlive-latex-extra

Try: sudo apt install <deb name>



valentin@valentin:~/code/Vue.js/Vue Mastery/Real World Vue.js$ npm i core-js

> core-js@3.6.4 postinstall /home/valentin/code/Vue.js/Vue Mastery/Real World Vue.js/node_modules/core-js
> node -e "try{require('./postinstall')}catch(e){}"

npm WARN saveError ENOENT: no such file or directory, open '/home/valentin/code/Vue.js/Vue Mastery/Real World Vue.js/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/home/valentin/code/Vue.js/Vue Mastery/Real World Vue.js/package.json'
npm WARN Real World Vue.js No description
npm WARN Real World Vue.js No repository field.
npm WARN Real World Vue.js No README data
npm WARN Real World Vue.js No license field.

+ core-js@3.6.4
updated 1 package and audited 469 packages in 1.471s

3 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities
valentin@valentin:~$ npm outdated
Package                Current  Wanted  Latest  Location
@vue/babel-preset-app    4.1.0   4.2.2   4.2.2  global

Я использовал пряжу, и результат был:

valentin@valentin:~$ yarn global add @vue/cli
yarn global v1.21.1
[1/4] Resolving packages...
[2/4] Fetching packages...
info fsevents@1.2.11: The platform "linux" is incompatible with this module.
info "fsevents@1.2.11" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
[4/4] Building fresh packages...

success Installed "@vue/cli@4.2.2" with binaries:
      - vue
Done in 2.65s.
valentin@valentin:~$ vue --version

Command 'vue' not found, did you mean:

  command 'vpe' from deb texlive-latex-extra

Try: sudo apt install <deb name>

Как вы можете видеть, это бесконечный процесс. Я читаю много потоков в стеке, git, et c. но они не помогли. Может быть, это потому, что я не установил nodejs перед установкой vue / cli, но затем удалил nodejs и установил, попытался установить vue / cli снова, но безуспешно.

Имеет ли какое-то значение, если я установите эти 2 на ветке моего проекта или на root, если вы делаете это глобально. Я думаю, что это тоже не проблема.

...