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

[vue-loader] vue-template-compiler must be installed as a peer dependency, or a compatible compiler implementation must be passed via options. #3

Closed
HankBrown opened this issue Apr 25, 2019 · 8 comments

Comments

@HankBrown
Copy link

HankBrown commented Apr 25, 2019

Vigorous hand clapping and thumbs up on your tutorial. You are a talented writer.
Thank you for sharing your work.

Build error:

Module build failed (from ./node_modules/vue-loader/lib/index.js):
  Error: [vue-loader] vue-template-compiler must be installed as a peer dependency, or a compatible compiler implementation must be passed via options.

Possible solutions:

https://myquickfix.co.uk/2019/01/08/fixing-vue-loader-vue-template-compiler-must-be-installed-as-a-peer-dependency/

https://medium.com/@nchutchind/i-ended-up-getting-the-following-error-vue-loader-vue-template-compiler-must-be-installed-as-a-37e8c007c1cc

But in my case...

$ npm show vue-template-compiler version
2.6.10
$ npm show vue version
2.6.10

I suppose this is related to the latest release of quasar. I see another having the same issue...

(https://forum.quasar-framework.org/topic/3110/fresh-install-of-quasar-cli-and-quasar-dev-won-t-work/4)

My webpack fu is not good enough to truly understand what is required of me here.

Later:

npm install --dev vue-template-compiler

That got me past this error. There are more issues but they were self-explanatory. The final build has "critical" errors but ran and behaved.

@hawkeye64
Copy link
Owner

Thanks for figuring this out. I'll be taking a look at it on the weekend.

@hawkeye64
Copy link
Owner

I pulled a new clone and built without issue. I believe the problem here was that you likely used npm to build and we have definitive proof that npm has issues with local packages and dependencies. It is recommended to install yarn, remove your node_modules folder, run yarn, then run yarn dev.

Would you be so helpful and try out these steps? Thanks.

@HankBrown
Copy link
Author

HankBrown commented Apr 29, 2019

Have just recently switched from npm to https://verdaccio.org/
But I read it should not make a difference.
Tried again with npm (hey ya never know), same result.

Installed yarn. Don't like using brew on a mac and sure enough it gave me all kinds of warnings and required me to re-install node. Saved all that output and need to crawl over it to maybe spot a helpful message.

Eventually I think I am ok...

$ yarn --version
1.15.2
$ node --version
v10.15.3

Fail to run. Then I notice you said "yarn dev". That gets me further. Now it looks like it did last week. I have the electron app running and can navigate the file system. But it is has problems.

Both npm and yarn say:

This dependency was not found:

* aws-sdk in ./node_modules/fsevents/node_modules/node-pre-gyp/lib/info.js, ./node_modules/fsevents/node_modules/node-pre-gyp/lib/publish.js and 1 other

... but yarn installs it okay.

The runtime error is:

WARNING in ./node_modules/electron-debug/index.js 81:45-58
Critical dependency: the request of a dependency is an expression
 @ ./src-electron/main-process/electron-main.dev.js
 @ multi ./src-electron/main-process/electron-main.dev.js

WARNING in ./node_modules/electron-debug/index.js 84:85-106
Critical dependency: the request of a dependency is an expression
 @ ./src-electron/main-process/electron-main.dev.js
 @ multi ./src-electron/main-process/electron-main.dev.js

 app:electron Booting up Electron process... +2ms
 app:spawn Running "/Users/brownhanky/home/brownhanky/bhjs/FEXPLORE/node_modules/electron/dist/Electron.app/Contents/MacOS/Electron --inspect=5858 /Users/brownhanky/home/brownhanky/bhjs/FEXPLORE/.quasar/electron/electron-main.js" +1ms

Debugger listening on ws://127.0.0.1:5858/c202a730-7681-4e2a-87ba-6d658ffca906
For help, see: https://nodejs.org/en/docs/inspector
2019-04-29 07:42:42.516 Electron Helper[21134:589154] Couldn't set selectedTextBackgroundColor from default ()

The console messages are many (attached). node-gyp is some kind of problem child.

So I don't know. Have I got something messed up in yarn/brew/node/npm/verdaccio ?
Could easily be. I'm not able to find and fix that fast. I must call in help.

I attach a log of what I did with screen prints.

This may not be a big deal, my experience with these package tools is very very limited, and I'm no expert in vue, quasar and electron. Nor are my problems yours to resolve. I leave you with the log and screen prints, I won't know more until my guru returns late this week, or I make time to investigate further. Today time is limited. Thank you for the update.
YARN-CON-1
YARN-CON-2
YARN-CON-3
YARN-DEV FEXPLORE 2019 04 29

cmdline...

YARN.FEXPLORE.2019.04.29.txt

ps: Last run shown in log is "quasar dev", but console prints from "yarn dev".

@hawkeye64
Copy link
Owner

Yeah, that's ugly.
node-gyp is a cross-platform command-line tool written in Node.js for compiling native addon modules for Node.js, which takes away the pain of dealing with the various differences in build platforms.
If that's having issues then there is something going on deeper here.
Possibly C++ libraries that it needs available on the local system to build whatever is needed into node.
I'm really not an expert in that at all.

@hawkeye64
Copy link
Owner

hawkeye64 commented Apr 30, 2019

try these steps:

  1. npm i --dev vue-template-compiler
  2. quasar clean
  3. npm run dev
    See if that works out for you

@hawkeye64
Copy link
Owner

I merged in #1 which should fix this issue. Can you test, and if it works close this issue. If it doesn't work out for you, let me know.

@HankBrown
Copy link
Author

Module build failed (from ./node_modules/vue-loader/lib/index.js):
Error: [vue-loader] vue-template-compiler must be installed as a peer dependency, or a compatible compiler implementation must be passed via options.

I killed over an hour, reinstalling node and yarn and various.
I can make no sense of this. It is above my pay grade

I gave it to my vue developer. Fresh machine. He also failed.

Aggravating. No idea, sorry. I saved a text file of everything I ran if you want to see it.
But this is going nowhere for me and I must move on.

Pretty sure I have valid installs for yarn, node and npm now.
But something must be mis-configured.

I didn't quite understand changing the code change for "Any drawback to adding that so that it works with NPM?", did it anyway, no joy.

Sorry I can't be more helpful. This is a disappointment for me and a constant worry now for dependency hell. I don't want to waste your time if this is my machine/config.

Close the issue if you can't deal with it. I won't ask for more of your time.

@hawkeye64
Copy link
Owner

This package has been updated to use Quasar v1.14.1and Electron 10. The issue is no longer relevant.

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

2 participants