quasarframework / app-extension-typescript

Add TypeScript to your existing Quasar 1.0 JS project

Home Page:https://quasar.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Installation problem (Windows 10)

rfox12 opened this issue · comments

Below is my output after doing "> quasar ext add @quasar/typescript"
Seems to be successful and then an error afterwards? Perhaps related to this (https://stackoverflow.com/questions/37459717/error-spawn-enoent-on-windows)?


 app:extension Installing "@quasar/typescript" Quasar App Extension +0ms

 app:extension Retrieving "@quasar/quasar-app-extension-typescript"... +5ms
 app:spawn [sync] Running "npm install --save-dev @quasar/quasar-app-extension-typescript" +1ms

npm WARN ts-loader@5.4.5 requires a peer of typescript@* but none is installed. You must install peer dependencies yourself.
npm WARN fork-ts-checker-webpack-plugin@0.5.2 requires a peer of tslint@^4.0.0 || ^5.0.0 but none is installed. You must install peer dependencies yourself.npm WARN fork-ts-checker-webpack-plugin@0.5.2 requires a peer of typescript@^2.1.0 || ^3.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules\webpack-dev-server\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules\watchpack\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules\fork-ts-checker-webpack-plugin\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.0.7 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.0.7: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

+ @quasar/quasar-app-extension-typescript@1.0.0-beta.1
added 41 packages from 39 contributors and audited 16930 packages in 34.324s
found 0 vulnerabilities



   ╭────────────────────────────────────────────────────────────────╮
   │                                                                │
   │      New minor version of npm available! 6.9.0 -> 6.10.3       │
   │   Changelog: https://github.com/npm/cli/releases/tag/v6.10.3   │
   │               Run npm install -g npm to update!                │
   │                                                                │
   ╰────────────────────────────────────────────────────────────────╯
? Please choose how to derive webpack: Use the fork-ts-checker-webpack-plugin module for type-checking (recommended)
? Rename .js files to .ts (experimental) Yes
? Will you use VSCode for this project? (Adds ESLint and Vetur configuration quirks, you must manually install the extensions) Yes
? Generate prettier configuration (ESLint and VScode, if used)? Yes

 app:extension-manager Updating /quasar.extensions.json for "@quasar/typescript" extension ... +3m
 app:extension Running App Extension install script... +42ms

We could not automatically update your quasar.conf.js to
use typescript. Quasar looks for *.js files by default.
Please add this to your quasar.conf.js:

sourceFiles: {
  router: 'src/router/index.ts',
  store: 'src/store/index.ts'
}

 app:extension Updating dependencies... +1s
 app:spawn [sync] Running "npm install" +14ms

npm WARN fork-ts-checker-webpack-plugin@0.5.2 requires a peer of tslint@^4.0.0 ||
^5.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN @typescript-eslint/eslint-plugin@1.13.0 requires a peer of eslint@^5.0.0
but none is installed. You must install peer dependencies yourself.
npm WARN @typescript-eslint/parser@1.13.0 requires a peer of eslint@^5.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN eslint-config-prettier@6.0.0 requires a peer of eslint@>=3.14.1 but none
is installed. You must install peer dependencies yourself.
npm WARN @typescript-eslint/experimental-utils@1.13.0 requires a peer of eslint@*
but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules\webpack-dev-server\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules\watchpack\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules\fork-ts-checker-webpack-plugin\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.0.7 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.0.7: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

added 16 packages from 14 contributors, updated 1 package and audited 16965 packages in 40.648s
found 0 vulnerabilities

 app:extension Quasar App Extension "@quasar/typescript" successfully installed. +46s

(node:42876) UnhandledPromiseRejectionWarning:   Error: spawn yarn ENOENT

  - enoent.js:6 notFoundError
    [client]/[cross-spawn]/lib/enoent.js:6:26

  - enoent.js:40 verifyENOENT
    [client]/[cross-spawn]/lib/enoent.js:40:16

  - enoent.js:27 ChildProcess.cp.emit
    [client]/[cross-spawn]/lib/enoent.js:27:25

  - child_process.js:248 Process.ChildProcess._handle.onexit
    internal/child_process.js:248:12


(node:42876) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:42876) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
commented

And you please provide the output of Quasar Info?

I can confirm the problem, after just running the following commands:

quasar create <folder_name>
cd <folder_name>
quasar ext add @quasar/typescript

Unfortunately, in my case the setup doesn't finish properly. Let me know if you need more information.

Thanks for having a look into it!

console output

? Please choose how to derive webpack: Use vanilla ts-loader
? Rename .js files to .ts (experimental) Yes
? Will you use VSCode for this project? (Adds ESLint and Vetur configuration quirks, you must manually install the exten
sions) Yes
? Generate prettier configuration (ESLint and VScode, if used)? Yes

 app:extension-manager Updating /quasar.extensions.json for "@quasar/typescript" extension ... +42s
 app:extension Running App Extension install script... +14ms
? Overwrite ".eslintrc.js"? (Use arrow keys)
> Overwrite
  Overwrite all
  Skip (might break extension)
  Skip all (might break extension) (node:12716) UnhandledPromiseRejectionWarning:   Error: spawn yarn ENOENT

  - enoent.js:6 notFoundError
    [codebase-quasar-12]/[cross-spawn]/lib/enoent.js:6:26
  - enoent.js:40 verifyENOENT
    [codebase-quasar-12]/[cross-spawn]/lib/enoent.js:40:16
  - enoent.js:27 ChildProcess.cp.emit
    [codebase-quasar-12]/[cross-spawn]/lib/enoent.js:27:25
  - child_process.js:272 Process.ChildProcess._handle.onexit
    internal/child_process.js:272:12

(node:12716) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)

quasar info

Operating System - Windows_NT(10.0.18362) - win32/x64
NodeJs - 12.8.0

Global packages
  NPM - 6.9.0
  yarn - Not installed
  @quasar/cli - 1.0.0
  cordova - Not installed

Important local packages
  quasar - 1.0.5 -- Build high-performance VueJS user interfaces (SPA, PWA, SSR, Mobile and Desktop) in record time
  @quasar/app - 1.0.4 -- Quasar Framework local CLI
  @quasar/extras - 1.2.0 -- Quasar Framework fonts, icons and animations     
  vue - 2.6.10 -- Reactive, component-oriented view layer for modern web interfaces.
  vue-router - 3.0.7 -- Official router for Vue.js 2
  vuex - 3.1.1 -- state management for Vue.js
  electron - Not installed
  electron-packager - Not installed
  electron-builder - Not installed
  @babel/core - 7.5.5 -- Babel compiler core.
  webpack - 4.35.3 -- Packs CommonJs/AMD modules for the browser. Allows to split your codebase into multiple bundles, which can be loaded on demand. Support loaders to preprocess files, i.e. json, jsx, es7, css, less, ... and your custom stuff.
  webpack-dev-server - 3.7.2 -- Serves a webpack app. Updates the browser on 
changes.
  workbox-webpack-plugin - 4.3.1 -- A plugin for your Webpack build process, 
  register-service-worker - 1.6.2 -- Script for registering service worker, with hooks
Quasar App Extensions  @quasar/quasar-app-extension-typescript - 1.0.0-beta.1 -- A Quasar CLI Extension
commented

This happens because the extension is trying to spawn a yarn process but you don't have yarn installed. Ideally the extension should determine whether it should use npm or yarn. As a workaround for now, you can try to install yarn and run the script again.

I've just created a before and after project and can confirm that the suggested workaround works.
Thank you for your help, very much appreciated.

I just tried this on a fresh/newly created project and it didn't work.
I have Yarn 1.21.1

Output of quasar info:

Operating System - Windows_NT(10.0.18362) - win32/x64
NodeJs - 10.13.0

Global packages
  NPM - 6.13.6
  yarn - 1.21.1
  @quasar/cli - 1.0.5
  cordova - Not installed

Important local packages
  quasar - 1.8.2 -- Build high-performance VueJS user interfaces (SPA, PWA, SSR, Mobile and Desktop) in record time
  @quasar/app - 1.5.2 -- Quasar Framework local CLI
  @quasar/extras - 1.5.0 -- Quasar Framework fonts, icons and animations
  vue - 2.6.11 -- Reactive, component-oriented view layer for modern web interfaces.
  vue-router - 3.1.3 -- Official router for Vue.js 2
  vuex - 3.1.2 -- state management for Vue.js
  electron - Not installed
  electron-packager - Not installed
  electron-builder - Not installed
  @capacitor/core - Not installed
  @capacitor/cli - Not installed
  @capacitor/android - Not installed
  @capacitor/ios - Not installed
  @babel/core - 7.8.3 -- Babel compiler core.
  webpack - 4.41.5 -- Packs CommonJs/AMD modules for the browser. Allows to split your codebase into multiple bundles, which can be loaded on demand. Support loaders to preprocess files, i.e. json, jsx, es7, css, less, ... and your custom stuff.
  webpack-dev-server - 3.10.1 -- Serves a webpack app. Updates the browser on changes.
  workbox-webpack-plugin - 4.3.1 -- A plugin for your Webpack build process, helping you generate a manifest of local files that workbox-sw should precache.
  register-service-worker - 1.6.2 -- Script for registering service worker, with hooks

Quasar App Extensions
  @quasar/quasar-app-extension-typescript - 1.0.0-beta.2 -- A Quasar CLI Extension

FIX UPDATE:

In my case it worked perfectly after updating Node to 12.14.1

Should be fixed by #48