theia-blueprint icon indicating copy to clipboard operation
theia-blueprint copied to clipboard

I keep getting Error: Cannot find module 'node-pty/build/Release/spawn-helper' when trying to build blueprint browser in WSL

Open KarthikHebbarMN opened this issue 1 year ago • 1 comments

Error: Cannot find module 'node-pty/build/Release/spawn-helper' Require stack:

Error: Cannot find module 'node-pty/build/Release/spawn-helper'
Require stack:
- /mnt/d/Work/experiments/theia-bp-test/theia-blueprint/node_modules/@theia/native-webpack-plugin/lib/native-webpack-plugin.js
- /mnt/d/Work/experiments/theia-bp-test/theia-blueprint/node_modules/@theia/native-webpack-plugin/lib/index.js
- /mnt/d/Work/experiments/theia-bp-test/theia-blueprint/applications/browser/gen-webpack.node.config.js
- /mnt/d/Work/experiments/theia-bp-test/theia-blueprint/applications/browser/webpack.config.js
- /mnt/d/Work/experiments/theia-bp-test/theia-blueprint/node_modules/webpack-cli/lib/webpack-cli.js
- /mnt/d/Work/experiments/theia-bp-test/theia-blueprint/node_modules/webpack-cli/lib/bootstrap.js
- /mnt/d/Work/experiments/theia-bp-test/theia-blueprint/node_modules/webpack-cli/bin/cli.js
- /mnt/d/Work/experiments/theia-bp-test/theia-blueprint/node_modules/webpack/bin/webpack.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1048:15)
    at Function.resolve (/mnt/d/Work/experiments/theia-bp-test/theia-blueprint/node_modules/v8-compile-cache/v8-compile-cache.js:164:23)
    at NativeWebpackPlugin.copyNodePtySpawnHelper (/mnt/d/Work/experiments/theia-bp-test/theia-blueprint/node_modules/@theia/native-webpack-plugin/lib/native-webpack-plugin.js:107:40)
    at /mnt/d/Work/experiments/theia-bp-test/theia-blueprint/node_modules/@theia/native-webpack-plugin/lib/native-webpack-plugin.js:82:28 {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/mnt/d/Work/experiments/theia-bp-test/theia-blueprint/node_modules/@theia/native-webpack-plugin/lib/native-webpack-plugin.js',
    '/mnt/d/Work/experiments/theia-bp-test/theia-blueprint/node_modules/@theia/native-webpack-plugin/lib/index.js',
    '/mnt/d/Work/experiments/theia-bp-test/theia-blueprint/applications/browser/gen-webpack.node.config.js',
    '/mnt/d/Work/experiments/theia-bp-test/theia-blueprint/applications/browser/webpack.config.js',
    '/mnt/d/Work/experiments/theia-bp-test/theia-blueprint/node_modules/webpack-cli/lib/webpack-cli.js',
    '/mnt/d/Work/experiments/theia-bp-test/theia-blueprint/node_modules/webpack-cli/lib/bootstrap.js',
    '/mnt/d/Work/experiments/theia-bp-test/theia-blueprint/node_modules/webpack-cli/bin/cli.js',
    '/mnt/d/Work/experiments/theia-bp-test/theia-blueprint/node_modules/webpack/bin/webpack.js'
  ]
}

Steps I followed are

  1. yarn
  2. yarn build:extensions && yarn download:plugins
  3. yarn browser build

Tried fixing it by doing npm i node-pty

The same build works in Docker, I am trying to build locally to see why custom vs extensions are not loading, they used to load in previous version but dont in the latest. I'll create separate issue for that ticket.

KarthikHebbarMN avatar Sep 11 '23 12:09 KarthikHebbarMN

Tried with node 16.20.2 as well. A prior step I did, to help with anything is npm i -g make. Because I got an npm error, make module not found. From then on I just retraced steps of that in docker file

 yarn --pure-lockfile && \
    yarn build:extensions && \
    yarn download:plugins && \
    yarn browser build

KarthikHebbarMN avatar Sep 12 '23 19:09 KarthikHebbarMN