vankasteelj / opensubtitles-api

nodejs opensubtitles.org api wrapper for downloading and uploading subtitles in multiple langs
110 stars 33 forks source link

Failed to compile on npm run build #29

Closed alextrevisan closed 5 years ago

alextrevisan commented 6 years ago

Hi, after create a app using create-react-app, and npm install --save opensubtitles-api and add: import OS from 'opensubtitles-api'; when i run npm run build I get this error:

Failed to compile.

Failed to minify the code from this file:

    ./node_modules/opensubtitles-api/lib/hash.js:5

Read more here: http://bit.ly/2tRViJ9

npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! player@0.1.0 build: react-scripts build npm ERR! Exit status 1

And the logfile:

0 info it worked if it ends with ok 1 verbose cli [ 'C:\Program Files\nodejs\node.exe', 1 verbose cli 'C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js', 1 verbose cli 'run', 1 verbose cli 'build' ] 2 info using npm@5.5.1 3 info using node@v9.1.0 4 verbose run-script [ 'prebuild', 'build', 'postbuild' ] 5 info lifecycle player@0.1.0~prebuild: player@0.1.0 6 info lifecycle player@0.1.0~build: player@0.1.0 7 verbose lifecycle player@0.1.0~build: unsafe-perm in lifecycle true 8 verbose lifecycle player@0.1.0~build: PATH: C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin;D:\ReactProjects\player\nodemodules.bin;C:\ProgramData\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files (x86)\Skype\Phone\;C:\Program Files (x86)\GtkSharp\2.12\bin;C:\ProgramData\ComposerSetup\bin;C:\Program Files\nodejs\;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Users\alex\AppData\Local\Microsoft\WindowsApps;D:\xampp\php;C:\Users\alex\AppData\Roaming\Composer\vendor\bin;C:\Users\alex\AppData\Roaming\npm;D:\Android\sdk\platform-tools;C:\Users\alex_\AppData\Local\atom\bin;%USERPROFILE%\AppData\Local\Microsoft\WindowsApps; 9 verbose lifecycle player@0.1.0~build: CWD: D:\ReactProjects\player 10 silly lifecycle player@0.1.0~build: Args: [ '/d /s /c', 'react-scripts build' ] 11 silly lifecycle player@0.1.0~build: Returned: code: 1 signal: null 12 info lifecycle player@0.1.0~build: Failed to exec build script 13 verbose stack Error: player@0.1.0 build: react-scripts build 13 verbose stack Exit status 1 13 verbose stack at EventEmitter. (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:280:16) 13 verbose stack at emitTwo (events.js:135:13) 13 verbose stack at EventEmitter.emit (events.js:224:7) 13 verbose stack at ChildProcess. (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14) 13 verbose stack at emitTwo (events.js:135:13) 13 verbose stack at ChildProcess.emit (events.js:224:7) 13 verbose stack at maybeClose (internal/child_process.js:943:16) 13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:220:5) 14 verbose pkgid player@0.1.0 15 verbose cwd D:\ReactProjects\player 16 verbose Windows_NT 10.0.16299 17 verbose argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "run" "build" 18 verbose node v9.1.0 19 verbose npm v5.5.1 20 error code ELIFECYCLE 21 error errno 1 22 error player@0.1.0 build: react-scripts build 22 error Exit status 1 23 error Failed at the player@0.1.0 build script. 23 error This is probably not a problem with npm. There is likely additional logging output above. 24 verbose exit [ 1, true ]

I'm missing something?

vankasteelj commented 6 years ago

I'm sorry I don't know anything about minifying or react. But if you find the issue, I'll be glad to merge a patch.

Note: the package does work without issue when you use it "as it" without post-processing it.

alextrevisan commented 6 years ago

yes it work well using npm start

vankasteelj commented 6 years ago

any news?

alextrevisan commented 6 years ago

actually yes, if i put the code in my src folder it works well, so i just copied the entire opensubtitles-api folder from node_modules to my src folder. I don't know the exact problem, but it seem to be direct export from class or arrow functions.

vankasteelj commented 5 years ago

I'll be closing this as nobody seems to want to make a PR. I don't use a minifier or other postprocessing tool, so I cannot help