yeoman / yo

CLI tool for running Yeoman generators

Home Page:http://yeoman.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error: Command failed: npm run prepare

Adem-Kri opened this issue · comments

Am trying to generate a Theia Extension using the command yo theia-extension. During the generation it all went well until reaching here

identical browser-app\package.json
identical electron-app\package.json
yarn install v1.22.19
[1/5] Validating package.json...
[2/5] Resolving packages...
ysuccess Already up-to-date.
$ theia check:theia-version
✅ Found 3 workspaces
✅ Found 23 dependencies
✅ No issues were found
$ lerna run prepare
lerna info version 2.4.0
hello-world-extension: > hello-world-extension@0.0.0 prepare
hello-world-extension: > yarn run clean && yarn run build
hello-world-extension: yarn run v1.22.19
hello-world-extension: warning package.json: No license field
hello-world-extension: $ rimraf lib
hello-world-extension: Done in 0.20s.
hello-world-extension: yarn run v1.22.19
hello-world-extension: warning package.json: No license field
hello-world-extension: $ tsc
hello-world-extension: src/browser/hello-world-extension-widget.test.ts(5,24): error TS2307: Cannot find module '@testing-library/react' or its corresponding type declarations.
hello-world-extension: src/browser/hello-world-extension-widget.test.ts(27,9): error TS2304: Cannot find name 'expect'.
hello-world-extension: src/browser/hello-world-extension-widget.test.ts(31,21): error TS2304: Cannot find name 'jest'.
hello-world-extension: src/browser/hello-world-extension-widget.test.ts(33,9): error TS2304: Cannot find name 'expect'.
hello-world-extension: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
hello-world-extension: error Command failed with exit code 2.
hello-world-extension: npm ERR! Lifecycle script `prepare` failed with error:
hello-world-extension: npm ERR! Error: command failed
hello-world-extension: npm ERR!   in workspace: hello-world-extension@0.0.0
hello-world-extension: npm ERR!   at location: C:\Users\kriouana\hello-world-extension
lerna ERR! execute callback with error
lerna ERR! Error: Command failed: npm run prepare
lerna ERR! warning package.json: No license field
lerna ERR! warning package.json: No license field
lerna ERR! error Command failed with exit code 2.
lerna ERR! npm ERR! Lifecycle script `prepare` failed with error:
lerna ERR! npm ERR! Error: command failed
lerna ERR! npm ERR!   in workspace: hello-world-extension@0.0.0
lerna ERR! npm ERR!   at location: C:\Users\kriouana\hello-world-extension
lerna ERR!
lerna ERR!
lerna ERR! > hello-world-extension@0.0.0 prepare
lerna ERR! > yarn run clean && yarn run build
lerna ERR!
lerna ERR! yarn run v1.22.19
lerna ERR! $ rimraf lib
lerna ERR! Done in 0.20s.
lerna ERR! yarn run v1.22.19
lerna ERR! $ tsc
lerna ERR! src/browser/hello-world-extension-widget.test.ts(5,24): error TS2307: Cannot find module '@testing-library/react' or its corresponding type declarations.
lerna ERR! src/browser/hello-world-extension-widget.test.ts(27,9): error TS2304: Cannot find name 'expect'.
lerna ERR! src/browser/hello-world-extension-widget.test.ts(31,21): error TS2304: Cannot find name 'jest'.
lerna ERR! src/browser/hello-world-extension-widget.test.ts(33,9): error TS2304: Cannot find name 'expect'.
lerna ERR! info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
lerna ERR!
lerna ERR!     at C:\Users\kriouana\node_modules\execa\index.js:236:11
node:internal/process/promises:279
            triggerUncaughtException(err, true /* fromPromise */);
            ^

Error: Command failed: npm run prepare
warning package.json: No license field
warning package.json: No license field
error Command failed with exit code 2.
npm ERR! Lifecycle script `prepare` failed with error:
npm ERR! Error: command failed
npm ERR!   in workspace: hello-world-extension@0.0.0
npm ERR!   at location: C:\Users\kriouana\hello-world-extension


> hello-world-extension@0.0.0 prepare
> yarn run clean && yarn run build

yarn run v1.22.19
$ rimraf lib
Done in 0.20s.
yarn run v1.22.19
$ tsc
src/browser/hello-world-extension-widget.test.ts(5,24): error TS2307: Cannot find module '@testing-library/react' or its corresponding type declarations.
src/browser/hello-world-extension-widget.test.ts(27,9): error TS2304: Cannot find name 'expect'.
src/browser/hello-world-extension-widget.test.ts(31,21): error TS2304: Cannot find name 'jest'.
src/browser/hello-world-extension-widget.test.ts(33,9): error TS2304: Cannot find name 'expect'.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

    at C:\Users\kriouana\node_modules\execa\index.js:236:11
    at processTicksAndRejections (node:internal/process/task_queues:96:5) {
  code: 1,
  killed: false,
  stdout: '\n' +
    '> hello-world-extension@0.0.0 prepare\n' +
    '> yarn run clean && yarn run build\n' +
    '\n' +
    'yarn run v1.22.19\n' +
    '$ rimraf lib\n' +
    'Done in 0.20s.\n' +
    'yarn run v1.22.19\n' +
    '$ tsc\n' +
    "src/browser/hello-world-extension-widget.test.ts(5,24): error TS2307: Cannot find module '@testing-library/react' or its corresponding type declarations.\r\n" +
    "src/browser/hello-world-extension-widget.test.ts(27,9): error TS2304: Cannot find name 'expect'.\r\n" +
    "src/browser/hello-world-extension-widget.test.ts(31,21): error TS2304: Cannot find name 'jest'.\r\n" +
    "src/browser/hello-world-extension-widget.test.ts(33,9): error TS2304: Cannot find name 'expect'.\r\n" +
    'info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.\n',
  stderr: 'warning package.json: No license field\n' +
    'warning package.json: No license field\n' +
    'error Command failed with exit code 2.\n' +
    'npm ERR! Lifecycle script `prepare` failed with error: \n' +
    'npm ERR! Error: command failed \n' +
    'npm ERR!   in workspace: hello-world-extension@0.0.0 \n' +
    'npm ERR!   at location: C:\\Users\\kriouana\\hello-world-extension \n',
  failed: true,
  signal: null,
  cmd: 'npm run prepare',
  timedOut: false,
  exitCode: 1
}
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

     _-----_     ╭───────────────────────╮
    |          |     │      Bye from us!     │
    |--(o)--|     │       Chat soon.      │
   `---------´   │      Yeoman team      │
    ( _´U`_ )      │    http://yeoman.io   │
    /___A___\   /╰───────────────────────╯
     |  ~  |
   __'.___.'__
 ´   `  |° ´ Y ` 

So I tried to add the required module '@testing-library/react' but didn't work either, HERE's the end of the log file

3058 verbose npm  v8.19.2
3059 error code 1
3060 error path C:\Users\kriouana\browser-app
3061 error command failed
3062 error command C:\WINDOWS\system32\cmd.exe /d /s /c theia build --mode development
3063 error Failed to resolve module: msgpackr
3063 error Failed to resolve module: socket.io
3063 error Failed to resolve module: ws
3063 error Error: spawn C:\Users\kriouana\node_modules\@theia\application-manager\node_modules\.bin\webpack.cmd ENOENT
3063 error     at Process.ChildProcess._handle.onexit (node:internal/child_process:285:19)
3063 error     at onErrorNT (node:internal/child_process:485:16)
3063 error     at processTicksAndRejections (node:internal/process/task_queues:83:21) {
3063 error   errno: -4058,
3063 error   code: 'ENOENT',
3063 error   syscall: 'spawn C:\\Users\\kriouana\\node_modules\\@theia\\application-manager\\node_modules\\.bin\\webpack.cmd',
3063 error   path: 'C:\\Users\\kriouana\\node_modules\\@theia\\application-manager\\node_modules\\.bin\\webpack.cmd',
3063 error   spawnargs: [ '--mode', 'development' ]
3063 error }
3064 verbose exit 1
3065 timing npm Completed in 89225ms
3066 verbose unfinished npm timer reify 1667296346040
3067 verbose unfinished npm timer reify:build 1667296413623
3068 verbose unfinished npm timer build 1667296413624
3069 verbose unfinished npm timer build:links 1667296425315
3070 verbose unfinished npm timer build:run:prepare 1667296425315
3071 verbose unfinished npm timer build:run:prepare:browser-app 1667296425315
3072 verbose unfinished npm timer build:run:prepare:electron-app 1667296425344
3073 verbose unfinished npm timer build:run:prepare:hello-world-extension 1667296425381
3074 verbose code 1
3075 error A complete log of this run can be found in:
3075 error     C:\Users\kriouana\AppData\Local\npm-cache\_logs\2022-11-01T09_52_25_897Z-debug-0.log

Here are my specs

win32 {
  node: '16.18.0',
  v8: '9.4.146.26-node.22',
  uv: '1.43.0',
  zlib: '1.2.11',
  brotli: '1.0.9',
  ares: '1.18.1',
  modules: '93',
  nghttp2: '1.47.0',
  napi: '8',
  llhttp: '6.0.10',
  openssl: '1.1.1q+quic',
  cldr: '41.0',
  icu: '71.1',
  tz: '2022b',
  unicode: '14.0',
  ngtcp2: '0.8.1',
  nghttp3: '0.7.0'
}

Thanks for the detailed info. Please file that issue over here:
https://github.com/eclipse-theia/generator-theia-extension