PeculiarVentures / fortify

Fortify enables web applications to use smart cards, local certificate stores and do certificate enrollment. This is the desktop application repository.
https://fortifyapp.com
Other
113 stars 32 forks source link

npm run build error #406

Closed jawn-ha closed 3 years ago

jawn-ha commented 3 years ago

$ npm run build

fortify@1.8.0 build /Users/zhanghuijun/Documents/fortify npm run build:prod

fortify@1.8.0 build:prod /Users/zhanghuijun/Documents/fortify cross-env NODE_ENV=production npm run build:main && cross-env NODE_ENV=production npm run build:renderer

fortify@1.8.0 build:main /Users/zhanghuijun/Documents/fortify webpack --config scripts/webpack.main.config.js

ℹ 「atl」: Using typescript@3.9.9 from typescript ℹ 「atl」: Using tsconfig.json from /Users/zhanghuijun/Documents/fortify/tsconfig.json ℹ 「atl」: Checking started in a separate process... ✖ 「atl」: Checking finished with 7 errors Hash: 070f723dc23e5eac3e01 Version: webpack 4.46.0 Time: 15998ms Built at: 2021-04-29 5:23:37 PM 1 asset Entrypoint main = main.js [12] external "fs" 42 bytes {0} [built] [15] external "os" 42 bytes {0} [built] [23] ./src/main/logger/index.ts 2.9 KiB {0} [built] [24] ./src/main/constants/index.ts 841 bytes {0} [built] [35] ./src/main/l10n.ts 2.3 KiB {0} [built] [41] external "electron" 42 bytes {0} [built] [77] ./src/main/config.ts 1.48 KiB {0} [built] [124] ./src/main/updater.ts 2.82 KiB {0} [built] [125] ./src/main/server.ts 13.6 KiB {0} [built] [134] ./node_modules/tsyringe/dist/esm5/index.js + 31 modules 40.6 KiB {0} [built] | 32 modules [239] ./src/main/container.ts 311 bytes {0} [built] [241] ./src/main/index.ts 295 bytes {0} [built] [243] ./src/main/application.ts 7.92 KiB {0} [built] [489] ./src/main/tray/index.ts 1010 bytes {0} [built] [523] ./src/main/firefox_providers.ts 2.6 KiB {0} [built]

WARNING in ./node_modules/got/source/request-as-event-emitter.js 72:18-25 Critical dependency: require function is used in a way in which dependencies cannot be statically extracted @ ./node_modules/got/source/as-stream.js @ ./node_modules/got/source/create.js @ ./node_modules/got/source/index.js @ ./node_modules/public-ip/index.js @ ./src/main/logger/analytics.ts @ ./src/main/logger/analytics_transport.ts @ ./src/main/logger/index.ts @ ./src/main/application.ts @ ./src/main/index.ts

WARNING in ./node_modules/keyv/src/index.js 18:14-40 Critical dependency: the request of a dependency is an expression @ ./node_modules/cacheable-request/src/index.js @ ./node_modules/got/source/request-as-event-emitter.js @ ./node_modules/got/source/as-stream.js @ ./node_modules/got/source/create.js @ ./node_modules/got/source/index.js @ ./node_modules/public-ip/index.js @ ./src/main/logger/analytics.ts @ ./src/main/logger/analytics_transport.ts @ ./src/main/logger/index.ts @ ./src/main/application.ts @ ./src/main/index.ts

WARNING in ./node_modules/fecha/lib/fecha.js Module Warning (from ./node_modules/source-map-loader/index.js): (Emitted value instead of an instance of Error) Cannot find SourceMap 'fecha.js.map': Error: Can't resolve './fecha.js.map' in '/Users/zhanghuijun/Documents/fortify/node_modules/fecha/lib' @ ./node_modules/logform/timestamp.js 3:14-30 @ ./node_modules/logform sync ^.\/.*.js$ @ ./node_modules/logform/index.js @ ./node_modules/winston/lib/winston.js @ ./src/main/logger/index.ts @ ./src/main/application.ts @ ./src/main/index.ts

WARNING in ./node_modules/@sindresorhus/is/dist/index.js Module Warning (from ./node_modules/source-map-loader/index.js): (Emitted value instead of an instance of Error) Cannot find source file '../source/index.ts': Error: Can't resolve '../source/index.ts' in '/Users/zhanghuijun/Documents/fortify/node_modules/@sindresorhus/is/dist' @ ./node_modules/got/source/errors.js 5:11-38 @ ./node_modules/got/source/create.js @ ./node_modules/got/source/index.js @ ./node_modules/public-ip/index.js @ ./src/main/logger/analytics.ts @ ./src/main/logger/analytics_transport.ts @ ./src/main/logger/index.ts @ ./src/main/application.ts @ ./src/main/index.ts

WARNING in ./node_modules/https-proxy-agent/dist/agent.js Module Warning (from ./node_modules/source-map-loader/index.js): (Emitted value instead of an instance of Error) Cannot find source file '../src/agent.ts': Error: Can't resolve '../src/agent.ts' in '/Users/zhanghuijun/Documents/fortify/node_modules/https-proxy-agent/dist' @ ./node_modules/https-proxy-agent/dist/index.js 5:32-50 @ ./node_modules/mixpanel/lib/mixpanel-node.js @ ./src/main/logger/analytics.ts @ ./src/main/logger/analytics_transport.ts @ ./src/main/logger/index.ts @ ./src/main/application.ts @ ./src/main/index.ts

WARNING in ./node_modules/get-proxy-settings/dist/defaults.js Module Warning (from ./node_modules/source-map-loader/index.js): (Emitted value instead of an instance of Error) Cannot find source file '../src/defaults.ts': Error: Can't resolve '../src/defaults.ts' in '/Users/zhanghuijun/Documents/fortify/node_modules/get-proxy-settings/dist' @ ./node_modules/get-proxy-settings/dist/index.js 6:9-30 @ ./src/main/utils/request.ts @ ./src/main/utils/index.ts @ ./src/main/l10n.ts @ ./src/main/application.ts @ ./src/main/index.ts

WARNING in ./node_modules/get-proxy-settings/dist/index.js Module Warning (from ./node_modules/source-map-loader/index.js): (Emitted value instead of an instance of Error) Cannot find source file '../src/index.ts': Error: Can't resolve '../src/index.ts' in '/Users/zhanghuijun/Documents/fortify/node_modules/get-proxy-settings/dist' @ ./src/main/utils/request.ts 4:29-58 @ ./src/main/utils/index.ts @ ./src/main/l10n.ts @ ./src/main/application.ts @ ./src/main/index.ts

WARNING in ./node_modules/https-proxy-agent/dist/index.js Module Warning (from ./node_modules/source-map-loader/index.js): (Emitted value instead of an instance of Error) Cannot find source file '../src/index.ts': Error: Can't resolve '../src/index.ts' in '/Users/zhanghuijun/Documents/fortify/node_modules/https-proxy-agent/dist' @ ./node_modules/mixpanel/lib/mixpanel-node.js 14:24-52 @ ./src/main/logger/analytics.ts @ ./src/main/logger/analytics_transport.ts @ ./src/main/logger/index.ts @ ./src/main/application.ts @ ./src/main/index.ts

WARNING in ./node_modules/https-proxy-agent/dist/parse-proxy-response.js Module Warning (from ./node_modules/source-map-loader/index.js): (Emitted value instead of an instance of Error) Cannot find source file '../src/parse-proxy-response.ts': Error: Can't resolve '../src/parse-proxy-response.ts' in '/Users/zhanghuijun/Documents/fortify/node_modules/https-proxy-agent/dist' @ ./node_modules/https-proxy-agent/dist/agent.js 21:47-80 @ ./node_modules/https-proxy-agent/dist/index.js @ ./node_modules/mixpanel/lib/mixpanel-node.js @ ./src/main/logger/analytics.ts @ ./src/main/logger/analytics_transport.ts @ ./src/main/logger/index.ts @ ./src/main/application.ts @ ./src/main/index.ts

WARNING in ./node_modules/get-proxy-settings/dist/proxy-errors.js Module Warning (from ./node_modules/source-map-loader/index.js): (Emitted value instead of an instance of Error) Cannot find source file '../src/proxy-errors.ts': Error: Can't resolve '../src/proxy-errors.ts' in '/Users/zhanghuijun/Documents/fortify/node_modules/get-proxy-settings/dist' @ ./node_modules/get-proxy-settings/dist/index.js 10:9-34 @ ./src/main/utils/request.ts @ ./src/main/utils/index.ts @ ./src/main/l10n.ts @ ./src/main/application.ts @ ./src/main/index.ts

WARNING in ./node_modules/get-proxy-settings/dist/proxy-settings.js Module Warning (from ./node_modules/source-map-loader/index.js): (Emitted value instead of an instance of Error) Cannot find source file '../src/proxy-settings.ts': Error: Can't resolve '../src/proxy-settings.ts' in '/Users/zhanghuijun/Documents/fortify/node_modules/get-proxy-settings/dist' @ ./node_modules/get-proxy-settings/dist/index.js 9:9-36 @ ./src/main/utils/request.ts @ ./src/main/utils/index.ts @ ./src/main/l10n.ts @ ./src/main/application.ts @ ./src/main/index.ts

WARNING in ./node_modules/get-proxy-settings/dist/proxy.js Module Warning (from ./node_modules/source-map-loader/index.js): (Emitted value instead of an instance of Error) Cannot find source file '../src/proxy.ts': Error: Can't resolve '../src/proxy.ts' in '/Users/zhanghuijun/Documents/fortify/node_modules/get-proxy-settings/dist' @ ./node_modules/get-proxy-settings/dist/index.js 7:9-27 @ ./src/main/utils/request.ts @ ./src/main/utils/index.ts @ ./src/main/l10n.ts @ ./src/main/application.ts @ ./src/main/index.ts

WARNING in ./node_modules/get-proxy-settings/dist/validate.js Module Warning (from ./node_modules/source-map-loader/index.js): (Emitted value instead of an instance of Error) Cannot find source file '../src/validate.ts': Error: Can't resolve '../src/validate.ts' in '/Users/zhanghuijun/Documents/fortify/node_modules/get-proxy-settings/dist' @ ./node_modules/get-proxy-settings/dist/index.js 8:9-30 @ ./src/main/utils/request.ts @ ./src/main/utils/index.ts @ ./src/main/l10n.ts @ ./src/main/application.ts @ ./src/main/index.ts

WARNING in ./node_modules/get-proxy-settings/dist/winreg.js Module Warning (from ./node_modules/source-map-loader/index.js): (Emitted value instead of an instance of Error) Cannot find source file '../src/winreg.ts': Error: Can't resolve '../src/winreg.ts' in '/Users/zhanghuijun/Documents/fortify/node_modules/get-proxy-settings/dist' @ ./node_modules/get-proxy-settings/dist/proxy.js 16:17-36 @ ./node_modules/get-proxy-settings/dist/index.js @ ./src/main/utils/request.ts @ ./src/main/utils/index.ts @ ./src/main/l10n.ts @ ./src/main/application.ts @ ./src/main/index.ts

ERROR in ./src/main/server.ts Module not found: Error: Can't resolve '@webcrypto-local/server' in '/Users/zhanghuijun/Documents/fortify/src/main' @ ./src/main/server.ts 7:17-51 @ ./src/main/application.ts @ ./src/main/index.ts

**ERROR in [at-loader] ./src/main/server.ts:4:27 TS2307: Cannot find module '@webcrypto-local/server' or its corresponding type declarations.

ERROR in [at-loader] ./src/main/server.ts:130:20 TS7006: Parameter 'level' implicitly has an 'any' type.

ERROR in [at-loader] ./src/main/server.ts:130:27 TS7006: Parameter 'source' implicitly has an 'any' type.

ERROR in [at-loader] ./src/main/server.ts:130:35 TS7006: Parameter 'message' implicitly has an 'any' type.

ERROR in [at-loader] ./src/main/server.ts:130:44 TS7006: Parameter 'data' implicitly has an 'any' type.

ERROR in [at-loader] ./src/main/server.ts:133:31 TS7006: Parameter 'card' implicitly has an 'any' type.

ERROR in [at-loader] ./src/main/server_storage.ts:1:27 TS2307: Cannot find module '@webcrypto-local/server' or its corresponding type declarations. npm ERR! code ELIFECYCLE** npm ERR! errno 2 npm ERR! fortify@1.8.0 build:main: webpack --config scripts/webpack.main.config.js npm ERR! Exit status 2 npm ERR! npm ERR! Failed at the fortify@1.8.0 build:main script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in: npm ERR! /Users/zhanghuijun/.npm/_logs/2021-04-29T09_23_37_315Z-debug.log npm ERR! code ELIFECYCLE npm ERR! errno 2 npm ERR! fortify@1.8.0 build:prod: cross-env NODE_ENV=production npm run build:main && cross-env NODE_ENV=production npm run build:renderer npm ERR! Exit status 2 npm ERR! npm ERR! Failed at the fortify@1.8.0 build:prod script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in: npm ERR! /Users/zhanghuijun/.npm/_logs/2021-04-29T09_23_37_361Z-debug.log npm ERR! code ELIFECYCLE npm ERR! errno 2 npm ERR! fortify@1.8.0 build: npm run build:prod npm ERR! Exit status 2 npm ERR! npm ERR! Failed at the fortify@1.8.0 build script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in: npm ERR! /Users/zhanghuijun/.npm/_logs/2021-04-29T09_23_37_401Z-debug.log

jawn-ha commented 3 years ago

There is no server in node_modules/@webcrypto-local. image

donskov commented 3 years ago

Hello @jawn-ha,

Thank you for the response. I tried raw app installation and build and all is fine. Also, my node_modules has @webcrypto-local/server dependency.

image

Could you try to clone and install modules again?

jawn-ha commented 3 years ago

Hi, @donskov Thanks for your reply Could you tell me about your node version 、npm version and which registry you are using I use node v10 and v12 all have this problem

donskov commented 3 years ago

@jawn-ha I have node v14. But the previous version is v12.

microshine commented 3 years ago

It's interesting. But @webcrypto-local/server is in package dependencies

https://github.com/PeculiarVentures/fortify/blob/master/package.json#L78

@jawn-ha Try to remove node_modules folder and package_lock.json file and install dependencies

npm install

Maybe you've got some errors during the installation process. It could be a reason why you don't have some required packages

jawn-ha commented 3 years ago

@microshine Thanks for your reply! I had solved it. The reason is there is no xcode-select in my macbook Now there is two warning when npm run start

$ npm run start

fortify@1.8.0 start electron .

certutil: function failed: SEC_ERROR_BAD_DATABASE: security library: bad database. (node:57575) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.

What shoult to do how can i fix it