tronprotocol / tronweb

Javascript API Library for interacting with the TRON Network
MIT License
440 stars 277 forks source link

i need help for build in windows #406

Closed mrtnetwork closed 1 year ago

mrtnetwork commented 1 year ago

I try to build tronweb in Windows but i got some errors like

ERROR in ./node_modules/@babel/runtime/regenerator/index.js 1:0
Module parse failed: 'import' and 'export' may appear only with 'sourceType: module' (1:0)
File was processed with these loaders:
 * ./node_modules/babel-loader/lib/index.js
You may need an additional loader to handle the result of these loaders.
> import _typeof from "@babel/runtime/helpers/typeof";
| // TODO(Babel 8): Remove this file.
| 
 @ ./src/index.js 10:0-61 99:64-88 101:15-39 289:57-81 292:15-39 485:59-83 487:15-39

webpack 5.88.2 compiled with 1 error and 5 warnings in 31850 ms

node -v

v18.17.0

npm -v

9.8.1
mrtnetwork commented 1 year ago
 options: {
                            sourceType: "unambiguous", // this line fix build
                            presets: [
                                ['@babel/preset-env', {
                                    targets: {
                                        node: 6
                                    },
                                    forceAllTransforms: true
                                }]
                            ],
                            plugins: nodePlugins
                        }