2

I want start to using ExtJS Community Edition. I follow this instruction http://docs.sencha.com/extjs/6.6.0-CE/guides/getting_started/open_tooling.html.

I try execute command:

 ext-gen app -a

But, I have this error:

i [ext]: ext-gen: E:\/cool-universal-app created
i [ext]: ext-gen: package.json created for cool-universal-app
i [ext]: ext-gen: webpack.config.js created for cool-universal-app
i [ext]: ext-gen: npm install -s started for cool-universal-app
i [ext]: ext-gen: npm install -s completed for cool-universal-app
(node:4908) UnhandledPromiseRejectionWarning: Error: Cannot find module 'E:\cool-universal-app\node_modules\@sencha\ext\package.json'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15)
    at Function.Module._load (internal/modules/cjs/loader.js:507:25)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:20:18)
    at stepCreate (C:\Users\pi\AppData\Roaming\npm\node_modules\@sencha\ext-gen\ext-gen.js:597:22)
    at process._tickCallback (internal/process/next_tick.js:68:7)
(node:4908) 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: 1)
(node:4908) [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.

My versions:

E:\>node -v
v10.10.0

E:\>npm -v
6.4.1

E:\>java -version
java version "11.0.2" 2019-01-15 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.2+9-LTS)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.2+9-LTS, mixed mode)

What's wrong? Why I get this error? How to can fix it?

All_Safe
  • 1,339
  • 2
  • 23
  • 43

1 Answers1

4

Looks like there is a package priority problem in ext-gen, because it requires two sencha packages to be installed in advance, and throw error because they are not.

Sencha still didn't fix this issue, so I made a tiny monkey-patch to solve it. So, open your "C:\Users\pi\AppData\Roaming\npm\node_modules@sencha\ext-gen\ext-gen.js", and add the following line before line 597:

await util.spawnPromise(command, ['install', '@sencha/ext', '@sencha/cmd'], options, []);

At the end, it must look like this:

  await util.spawnPromise(command, ['install', '@sencha/ext', '@sencha/cmd'], options, []);

  var frameworkPath = path.join(destDir, 'node_modules', npmScope, 'ext', 'package.json');
  var cmdPath = path.join(destDir, 'node_modules', npmScope, 'cmd', 'package.json');




abeyaz
  • 3,034
  • 1
  • 16
  • 20