Closed mengxiangyue closed 2 years ago
看起来是 node 16 和 npm8 才会出现,请拉一下 main 分支的代码再试试?
先用 npm i --legacy-peer-deps
安装下,npm8 导致有一些依赖需要升级
npm install
成功了,但是 npm run build
失败了
npm run build
> build
> rimraf -rf ./app && rimraf -rf ./out && run-p build:*
> build:browser
> webpack --config ./build/webpack.browser.config.js
> build:main
> webpack --config ./build/webpack.main.config.js
> build:node
> webpack --config ./build/webpack.node.config.js
> build:webview
> webpack --config ./build/webpack.webview.config.js
> build:extension
> webpack --config ./build/webpack.extension-host.config.js
asset host-preload.js 22.3 KiB [emitted] (name: main)
asset plain-preload.js 1.35 KiB [emitted] [from: node_modules/@opensumi/ide-webview/lib/electron-webview/plain-preload.js] [copied]
modules by path ./node_modules/@opensumi/ide-webview/lib/electron-webview/*.js 2.12 KiB
./node_modules/@opensumi/ide-webview/lib/electron-webview/host-preload.js 54 bytes [built] [code generated]
./node_modules/@opensumi/ide-webview/lib/electron-webview/host-channel.js 2.07 KiB [built] [code generated]
modules by path ./node_modules/@opensumi/ide-webview/lib/webview-host/*.js 15.2 KiB
./node_modules/@opensumi/ide-webview/lib/webview-host/webview-manager.js 12.6 KiB [built] [code generated]
./node_modules/@opensumi/ide-webview/lib/webview-host/common.js 2.57 KiB [built] [code generated]
external "electron" 42 bytes [built] [code generated]
webpack 5.72.1 compiled successfully in 150 ms
asset index.js 1.72 MiB [emitted] (name: main) 1 related asset
runtime modules 793 bytes 4 modules
modules by path ./node_modules/ 1.54 MiB
cacheable modules 1.54 MiB 339 modules
./node_modules/yargs/ sync 160 bytes [built] [code generated]
./node_modules/yargs/build/ sync 160 bytes [built] [code generated]
./node_modules/yargs-parser/build/ sync 160 bytes [built] [code generated]
modules by path ./src/ 11.3 KiB
modules by path ./src/main/ 9.37 KiB
modules by path ./src/main/*.ts 7.39 KiB 3 modules
modules by path ./src/main/services/*.ts 1.99 KiB 2 modules
modules by path ./src/common/ 1.94 KiB
./src/common/types.ts 150 bytes [built] [code generated]
./src/common/node/utils.ts 1.1 KiB [built] [code generated]
./src/common/constants.ts 706 bytes [built] [code generated]
+ 17 modules
WARNING in ./node_modules/yargs/build/index.cjs 1:60106-60113
Critical dependency: require function is used in a way in which dependencies cannot be statically extracted
@ ./node_modules/yargs/index.cjs 5:29-57
@ ./node_modules/@opensumi/ide-core-electron-main/lib/bootstrap/app.js 5:16-32
@ ./node_modules/@opensumi/ide-core-electron-main/lib/bootstrap/index.js 4:21-37
@ ./node_modules/@opensumi/ide-core-electron-main/lib/index.js 5:21-43
@ ./src/main/launch.ts 8:33-76
@ ./src/main/index.ts 6:17-36
WARNING in ./node_modules/yargs/build/index.cjs 1:60498-60505
Critical dependency: require function is used in a way in which dependencies cannot be statically extracted
@ ./node_modules/yargs/index.cjs 5:29-57
@ ./node_modules/@opensumi/ide-core-electron-main/lib/bootstrap/app.js 5:16-32
@ ./node_modules/@opensumi/ide-core-electron-main/lib/bootstrap/index.js 4:21-37
@ ./node_modules/@opensumi/ide-core-electron-main/lib/index.js 5:21-43
@ ./src/main/launch.ts 8:33-76
@ ./src/main/index.ts 6:17-36
WARNING in ./node_modules/yargs/index.cjs 12:39-46
Critical dependency: require function is used in a way in which dependencies cannot be statically extracted
@ ./node_modules/@opensumi/ide-core-electron-main/lib/bootstrap/app.js 5:16-32
@ ./node_modules/@opensumi/ide-core-electron-main/lib/bootstrap/index.js 4:21-37
@ ./node_modules/@opensumi/ide-core-electron-main/lib/index.js 5:21-43
@ ./src/main/launch.ts 8:33-76
@ ./src/main/index.ts 6:17-36
3 warnings have detailed information that is not shown.
Use 'stats.errorDetails: true' resp. '--stats-error-details' to show it.
webpack 5.72.1 compiled with 3 warnings in 1666 ms
asset index.js 6.8 MiB [emitted] (name: main) 1 related asset
runtime modules 1.04 KiB 5 modules
javascript modules 5.29 MiB
modules by path ./node_modules/ 5.28 MiB
cacheable modules 5.28 MiB 1016 modules
+ 5 modules
modules by path ./src/ 10.9 KiB 6 modules
+ 31 modules
json modules 925 KiB
modules by path ./node_modules/har-schema/lib/ 6.93 KiB 18 modules
modules by path ./node_modules/iconv-lite/ 86.7 KiB 8 modules
modules by path ./node_modules/ajv/lib/ 5.58 KiB 3 modules
modules by path ./node_modules/@opensumi/ 5.63 KiB
./node_modules/@opensumi/ide-core-common/lib/hash-calculate/md5.wasm.json 4.04 KiB [built] [code generated]
./node_modules/@opensumi/di/package.json 1.59 KiB [built] [code generated]
+ 6 modules
WARNING in ./node_modules/@opensumi/ide-extension/lib/node/languagePack.js 292:25-32
Critical dependency: require function is used in a way in which dependencies cannot be statically extracted
@ ./node_modules/@opensumi/ide-extension/lib/node/extension.service.client.js 13:32-57
@ ./node_modules/@opensumi/ide-extension/lib/node/index.js 11:35-72
@ ./src/node/index.ts 12:15-58
WARNING in ./node_modules/chrome-remote-interface/node_modules/ws/lib/BufferUtil.js 35:21-42
Module not found: Error: Can't resolve 'bufferutil' in '/Users/xiangyue/Desktop/opensumi-workspace/ide-electron/node_modules/chrome-remote-interface/node_modules/ws/lib'
Did you mean './bufferutil'?
Requests that should resolve in the current directory need to start with './'.
Requests that start with a name are treated as module requests and resolve within module directories (node_modules).
If changing the source code is not an option there is also a resolve options called 'preferRelative' which tries to resolve these kind of requests in the current directory too.
@ ./node_modules/chrome-remote-interface/node_modules/ws/lib/Receiver.js 13:19-42
@ ./node_modules/chrome-remote-interface/node_modules/ws/index.js 12:21-46
@ ./node_modules/chrome-remote-interface/lib/chrome.js 7:18-31
@ ./node_modules/chrome-remote-interface/index.js 6:15-41
@ ./node_modules/v8-inspect-profiler/index.js 10:12-46
@ ./node_modules/@opensumi/ide-extension/lib/node/extension.profiler.service.js 32:81-111
@ ./node_modules/@opensumi/ide-extension/lib/node/index.js 9:37-76
@ ./src/node/index.ts 12:15-58
WARNING in ./node_modules/chrome-remote-interface/node_modules/ws/lib/Validation.js 10:22-47
Module not found: Error: Can't resolve 'utf-8-validate' in '/Users/xiangyue/Desktop/opensumi-workspace/ide-electron/node_modules/chrome-remote-interface/node_modules/ws/lib'
@ ./node_modules/chrome-remote-interface/node_modules/ws/lib/Receiver.js 12:20-43
@ ./node_modules/chrome-remote-interface/node_modules/ws/index.js 12:21-46
@ ./node_modules/chrome-remote-interface/lib/chrome.js 7:18-31
@ ./node_modules/chrome-remote-interface/index.js 6:15-41
@ ./node_modules/v8-inspect-profiler/index.js 10:12-46
@ ./node_modules/@opensumi/ide-extension/lib/node/extension.profiler.service.js 32:81-111
@ ./node_modules/@opensumi/ide-extension/lib/node/index.js 9:37-76
@ ./src/node/index.ts 12:15-58
WARNING in ./node_modules/vscode-languageserver-types/lib/umd/main.js 3:24-31
Critical dependency: require function is used in a way in which dependencies cannot be statically extracted
@ ./node_modules/@opensumi/ide-file-service/lib/node/file-service.js 10:38-76
@ ./node_modules/@opensumi/ide-file-service/lib/node/index.js 9:23-48 10:21-46
@ ./src/node/index.ts 6:15-61
WARNING in ./node_modules/ws/lib/buffer-util.js 105:21-42
Module not found: Error: Can't resolve 'bufferutil' in '/Users/xiangyue/Desktop/opensumi-workspace/ide-electron/node_modules/ws/lib'
@ ./node_modules/ws/lib/websocket.js 27:21-45
@ ./node_modules/ws/index.js 3:18-44
@ ./node_modules/@opensumi/ide-connection/lib/node/common-channel-handler.js 6:37-50
@ ./node_modules/@opensumi/ide-connection/lib/node/index.js 9:21-56
@ ./node_modules/@opensumi/ide-core-node/lib/connection.js 7:15-59
@ ./node_modules/@opensumi/ide-core-node/lib/index.js 8:21-44
@ ./src/node/index.ts 5:24-58
WARNING in ./node_modules/ws/lib/validation.js 86:20-45
Module not found: Error: Can't resolve 'utf-8-validate' in '/Users/xiangyue/Desktop/opensumi-workspace/ide-electron/node_modules/ws/lib'
@ ./node_modules/ws/lib/receiver.js 13:43-66
@ ./node_modules/ws/index.js 7:21-46
@ ./node_modules/@opensumi/ide-connection/lib/node/common-channel-handler.js 6:37-50
@ ./node_modules/@opensumi/ide-connection/lib/node/index.js 9:21-56
@ ./node_modules/@opensumi/ide-core-node/lib/connection.js 7:15-59
@ ./node_modules/@opensumi/ide-core-node/lib/index.js 8:21-44
@ ./src/node/index.ts 5:24-58
WARNING in ./node_modules/yargs/build/index.cjs 1:60106-60113
Critical dependency: require function is used in a way in which dependencies cannot be statically extracted
@ ./node_modules/yargs/index.cjs 5:29-57
@ ./src/node/server.ts 6:35-51
@ ./src/node/index.ts 4:17-36
WARNING in ./node_modules/yargs/build/index.cjs 1:60498-60505
Critical dependency: require function is used in a way in which dependencies cannot be statically extracted
@ ./node_modules/yargs/index.cjs 5:29-57
@ ./src/node/server.ts 6:35-51
@ ./src/node/index.ts 4:17-36
WARNING in ./node_modules/yargs/index.cjs 12:39-46
Critical dependency: require function is used in a way in which dependencies cannot be statically extracted
@ ./src/node/server.ts 6:35-51
@ ./src/node/index.ts 4:17-36
9 warnings have detailed information that is not shown.
Use 'stats.errorDetails: true' resp. '--stats-error-details' to show it.
webpack 5.72.1 compiled with 9 warnings in 3020 ms
asset index.js 5.08 MiB [emitted] (name: main) 1 related asset
runtime modules 1.04 KiB 5 modules
cacheable modules 4.54 MiB 715 modules
+ 27 modules
WARNING in ./node_modules/vscode-languageserver-types/lib/umd/main.js 3:24-31
Critical dependency: require function is used in a way in which dependencies cannot be statically extracted
@ ./node_modules/@opensumi/ide-extension/lib/common/vscode/converter.js 7:38-76
@ ./node_modules/@opensumi/ide-extension/lib/hosted/api/vscode/ext.host.comments.js 12:50-93
@ ./node_modules/@opensumi/ide-extension/lib/hosted/api/vscode/ext.host.api.impl.js 17:28-58
@ ./node_modules/@opensumi/ide-extension/lib/hosted/ext.host.js 13:28-69
@ ./node_modules/@opensumi/ide-extension/lib/hosted/ext.process-base.js 73:22-43
@ ./src/extension/index.ts 3:30-95
WARNING in ./node_modules/ws/lib/buffer-util.js 105:21-42
Module not found: Error: Can't resolve 'bufferutil' in '/Users/xiangyue/Desktop/opensumi-workspace/ide-electron/node_modules/ws/lib'
@ ./node_modules/ws/lib/sender.js 12:38-62
@ ./node_modules/ws/index.js 8:19-42
@ ./node_modules/@opensumi/ide-connection/lib/node/common-channel-handler.js 6:37-50
@ ./node_modules/@opensumi/ide-connection/lib/node/index.js 9:21-56
@ ./node_modules/@opensumi/ide-extension/lib/hosted/ext.process-base.js 9:15-59
@ ./src/extension/index.ts 3:30-95
WARNING in ./node_modules/ws/lib/validation.js 86:20-45
Module not found: Error: Can't resolve 'utf-8-validate' in '/Users/xiangyue/Desktop/opensumi-workspace/ide-electron/node_modules/ws/lib'
@ ./node_modules/ws/lib/sender.js 11:30-53
@ ./node_modules/ws/index.js 8:19-42
@ ./node_modules/@opensumi/ide-connection/lib/node/common-channel-handler.js 6:37-50
@ ./node_modules/@opensumi/ide-connection/lib/node/index.js 9:21-56
@ ./node_modules/@opensumi/ide-extension/lib/hosted/ext.process-base.js 9:15-59
@ ./src/extension/index.ts 3:30-95
WARNING in ./node_modules/yargs/build/index.cjs 1:60106-60113
Critical dependency: require function is used in a way in which dependencies cannot be statically extracted
@ ./node_modules/yargs/index.cjs 5:29-57
@ ./node_modules/@opensumi/ide-extension/lib/hosted/ext.process-base.js 21:13-34
@ ./src/extension/index.ts 3:30-95
WARNING in ./node_modules/yargs/build/index.cjs 1:60498-60505
Critical dependency: require function is used in a way in which dependencies cannot be statically extracted
@ ./node_modules/yargs/index.cjs 5:29-57
@ ./node_modules/@opensumi/ide-extension/lib/hosted/ext.process-base.js 21:13-34
@ ./src/extension/index.ts 3:30-95
WARNING in ./node_modules/yargs/index.cjs 12:39-46
Critical dependency: require function is used in a way in which dependencies cannot be statically extracted
@ ./node_modules/@opensumi/ide-extension/lib/hosted/ext.process-base.js 21:13-34
@ ./src/extension/index.ts 3:30-95
6 warnings have detailed information that is not shown.
Use 'stats.errorDetails: true' resp. '--stats-error-details' to show it.
ERROR in ./node_modules/@opensumi/ide-extension/lib/common/vscode/converter.js 11:17-60
Module not found: Error: Can't resolve '@opensumi/ide-testing/lib/common' in '/Users/xiangyue/Desktop/opensumi-workspace/ide-electron/node_modules/@opensumi/ide-extension/lib/common/vscode'
@ ./node_modules/@opensumi/ide-extension/lib/hosted/api/vscode/ext.host.comments.js 12:50-93
@ ./node_modules/@opensumi/ide-extension/lib/hosted/api/vscode/ext.host.api.impl.js 17:28-58
@ ./node_modules/@opensumi/ide-extension/lib/hosted/ext.host.js 13:28-69
@ ./node_modules/@opensumi/ide-extension/lib/hosted/ext.process-base.js 73:22-43
@ ./src/extension/index.ts 3:30-95
ERROR in ./node_modules/@opensumi/ide-extension/lib/common/vscode/testing/testCollection.js 6:25-83
Module not found: Error: Can't resolve '@opensumi/ide-testing/lib/common/testCollection' in '/Users/xiangyue/Desktop/opensumi-workspace/ide-electron/node_modules/@opensumi/ide-extension/lib/common/vscode/testing'
@ ./node_modules/@opensumi/ide-extension/lib/hosted/api/vscode/ext.host.tests.js 26:25-81
@ ./node_modules/@opensumi/ide-extension/lib/hosted/api/vscode/ext.host.api.impl.js 36:25-52
@ ./node_modules/@opensumi/ide-extension/lib/hosted/ext.host.js 13:28-69
@ ./node_modules/@opensumi/ide-extension/lib/hosted/ext.process-base.js 73:22-43
@ ./src/extension/index.ts 3:30-95
ERROR in ./node_modules/@opensumi/ide-extension/lib/common/vscode/testing/testCollection.js 7:17-67
Module not found: Error: Can't resolve '@opensumi/ide-testing/lib/common/testId' in '/Users/xiangyue/Desktop/opensumi-workspace/ide-electron/node_modules/@opensumi/ide-extension/lib/common/vscode/testing'
@ ./node_modules/@opensumi/ide-extension/lib/hosted/api/vscode/ext.host.tests.js 26:25-81
@ ./node_modules/@opensumi/ide-extension/lib/hosted/api/vscode/ext.host.api.impl.js 36:25-52
@ ./node_modules/@opensumi/ide-extension/lib/hosted/ext.host.js 13:28-69
@ ./node_modules/@opensumi/ide-extension/lib/hosted/ext.process-base.js 73:22-43
@ ./src/extension/index.ts 3:30-95
ERROR in ./node_modules/@opensumi/ide-extension/lib/hosted/api/vscode/ext.host.tests.js 20:25-83
Module not found: Error: Can't resolve '@opensumi/ide-testing/lib/common/testCollection' in '/Users/xiangyue/Desktop/opensumi-workspace/ide-electron/node_modules/@opensumi/ide-extension/lib/hosted/api/vscode'
@ ./node_modules/@opensumi/ide-extension/lib/hosted/api/vscode/ext.host.api.impl.js 36:25-52
@ ./node_modules/@opensumi/ide-extension/lib/hosted/ext.host.js 13:28-69
@ ./node_modules/@opensumi/ide-extension/lib/hosted/ext.process-base.js 73:22-43
@ ./src/extension/index.ts 3:30-95
ERROR in ./node_modules/@opensumi/ide-extension/lib/hosted/api/vscode/ext.host.tests.js 21:17-67
Module not found: Error: Can't resolve '@opensumi/ide-testing/lib/common/testId' in '/Users/xiangyue/Desktop/opensumi-workspace/ide-electron/node_modules/@opensumi/ide-extension/lib/hosted/api/vscode'
@ ./node_modules/@opensumi/ide-extension/lib/hosted/api/vscode/ext.host.api.impl.js 36:25-52
@ ./node_modules/@opensumi/ide-extension/lib/hosted/ext.host.js 13:28-69
@ ./node_modules/@opensumi/ide-extension/lib/hosted/ext.process-base.js 73:22-43
@ ./src/extension/index.ts 3:30-95
5 errors have detailed information that is not shown.
Use 'stats.errorDetails: true' resp. '--stats-error-details' to show it.
webpack 5.72.1 compiled with 5 errors and 6 warnings in 3238 ms
asset index.worker.js 3.48 MiB [emitted] (name: main) 1 related asset
runtime modules 1010 bytes 5 modules
modules by path ./node_modules/@opensumi/ 2.04 MiB 343 modules
modules by path ./node_modules/jschardet/ 451 KiB 43 modules
modules by path ./node_modules/iconv-lite/ 198 KiB
modules by path ./node_modules/iconv-lite/encodings/ 188 KiB 18 modules
modules by path ./node_modules/iconv-lite/lib/*.js 10.6 KiB 3 modules
modules by path ./node_modules/uuid/dist/esm-browser/*.js 19.1 KiB
./node_modules/uuid/dist/esm-browser/index.js 412 bytes [built] [code generated]
+ 14 modules
modules by path ./node_modules/shortid/ 6.88 KiB 9 modules
modules by path ./node_modules/vscode-languageserver-types/lib/umd/ 90.6 KiB
./node_modules/vscode-languageserver-types/lib/umd/main.js 90.5 KiB [built] [code generated]
./node_modules/vscode-languageserver-types/lib/umd/ sync 160 bytes [built] [code generated]
+ 23 modules
WARNING in ./node_modules/vscode-languageserver-types/lib/umd/main.js 3:24-31
Critical dependency: require function is used in a way in which dependencies cannot be statically extracted
@ ./node_modules/@opensumi/ide-extension/lib/common/vscode/converter.js 7:38-76
@ ./node_modules/@opensumi/ide-extension/lib/hosted/api/vscode/ext.host.command.js 10:50-93
@ ./node_modules/@opensumi/ide-extension/lib/hosted/api/worker/worker.host.api.impl.js 14:27-64
@ ./node_modules/@opensumi/ide-extension/lib/hosted/worker.host.js 12:31-75
@ ./node_modules/@opensumi/ide-extension/lib/hosted/worker.host-preload.js 8:22-46
@ ./src/extension/index.worker.ts 3:0-65
1 warning has detailed information that is not shown.
Use 'stats.errorDetails: true' resp. '--stats-error-details' to show it.
ERROR in ./node_modules/@opensumi/ide-extension/lib/common/vscode/converter.js 11:17-60
Module not found: Error: Can't resolve '@opensumi/ide-testing/lib/common' in '/Users/xiangyue/Desktop/opensumi-workspace/ide-electron/node_modules/@opensumi/ide-extension/lib/common/vscode'
resolve '@opensumi/ide-testing/lib/common' in '/Users/xiangyue/Desktop/opensumi-workspace/ide-electron/node_modules/@opensumi/ide-extension/lib/common/vscode'
Parsed request is a module
using description file: /Users/xiangyue/Desktop/opensumi-workspace/ide-electron/node_modules/@opensumi/ide-extension/package.json (relative path: ./lib/common/vscode)
Field 'browser' doesn't contain a valid alias configuration
resolve as module
/Users/xiangyue/Desktop/opensumi-workspace/ide-electron/node_modules/@opensumi/ide-extension/lib/common/vscode/node_modules doesn't exist or is not a directory
/Users/xiangyue/Desktop/opensumi-workspace/ide-electron/node_modules/@opensumi/ide-extension/lib/common/node_modules doesn't exist or is not a directory
/Users/xiangyue/Desktop/opensumi-workspace/ide-electron/node_modules/@opensumi/ide-extension/lib/node_modules doesn't exist or is not a directory
/Users/xiangyue/Desktop/opensumi-workspace/ide-electron/node_modules/@opensumi/ide-extension/node_modules doesn't exist or is not a directory
/Users/xiangyue/Desktop/opensumi-workspace/ide-electron/node_modules/@opensumi/node_modules doesn't exist or is not a directory
/Users/xiangyue/Desktop/opensumi-workspace/ide-electron/node_modules/node_modules doesn't exist or is not a directory
looking for modules in /Users/xiangyue/Desktop/opensumi-workspace/ide-electron/node_modules
/Users/xiangyue/Desktop/opensumi-workspace/ide-electron/node_modules/@opensumi/ide-testing doesn't exist
/Users/xiangyue/Desktop/opensumi-workspace/node_modules doesn't exist or is not a directory
/Users/xiangyue/Desktop/node_modules doesn't exist or is not a directory
/Users/xiangyue/node_modules doesn't exist or is not a directory
/Users/node_modules doesn't exist or is not a directory
/node_modules doesn't exist or is not a directory
@ ./node_modules/@opensumi/ide-extension/lib/hosted/api/vscode/ext.host.command.js 10:50-93
@ ./node_modules/@opensumi/ide-extension/lib/hosted/api/worker/worker.host.api.impl.js 14:27-64
@ ./node_modules/@opensumi/ide-extension/lib/hosted/worker.host.js 12:31-75
@ ./node_modules/@opensumi/ide-extension/lib/hosted/worker.host-preload.js 8:22-46
@ ./src/extension/index.worker.ts 3:0-65
webpack 5.72.1 compiled with 1 error and 1 warning in 2816 ms
ERROR: "build:extension" exited with 1.
➜ ide-electron git:(main) ✗ node -v
v16.15.0
➜ ide-electron git:(main) ✗ npm -v
8.5.5
拉下 main 分支代码,新增的依赖包 @opensumi/ide-testing
@yantze 多谢回复,能够运行起来了,但是运行的时候有个如下的错误,会有啥问题没?
@yantze 多谢回复,能够运行起来了,但是运行的时候有个如下的错误,会有啥问题没?
这个是正常的,尝试去删除之前的通信 socket,这个之后会修复下
好的 多谢
webpack 5 依赖模块问题已修复,推到了 main 分支