Arnavion / libjass

Renders ASS subs in the browser.
Apache License 2.0
174 stars 29 forks source link

Put build instructions in README #88

Open XCanG opened 7 years ago

XCanG commented 7 years ago

I try to build it on Windows x64 and use nodejs for that. What I do, in root folder execute commands: npm install typescript npm install async npm install async-build npm install npm (that was require to build, because it not found) After that I run builder and it return that error

D:\Docs\libjass-master>node build.js
[11:45:03] build-tools - Starting
[11:45:03] version.ts - Starting
[11:45:03] version.ts - Succeeded

> libjass@0.12.0 build D:\Docs\libjass-master
> tsc -p ./build/tsconfig.json

build/typescript/walker.ts(189,38): error TS2339: Property 'Private' does not exist on type 'typeof NodeFlags'.
build/typescript/walker.ts(219,52): error TS2339: Property 'Private' does not exist on type 'typeof NodeFlags'.
build/typescript/walker.ts(220,54): error TS2339: Property 'Protected' does not exist on type 'typeof NodeFlags'.
build/typescript/walker.ts(221,51): error TS2339: Property 'Static' does not exist on type 'typeof NodeFlags'.
build/typescript/walker.ts(235,52): error TS2339: Property 'Private' does not exist on type 'typeof NodeFlags'.
build/typescript/walker.ts(258,52): error TS2339: Property 'Private' does not exist on type 'typeof NodeFlags'.
build/typescript/walker.ts(282,45): error TS2339: Property 'Ambient' does not exist on type 'typeof NodeFlags'.
build/typescript/walker.ts(302,53): error TS2339: Property 'Export' does not exist on type 'typeof NodeFlags'.
build/typescript/walker.ts(347,53): error TS2339: Property 'Export' does not exist on type 'typeof NodeFlags'.
build/typescript/walker.ts(351,7): error TS7017: Element implicitly has an 'any' type because type 'Map<Symbol>' has no index signature.
build/typescript/walker.ts(352,42): error TS7017: Element implicitly has an 'any' type because type 'Map<Symbol>' has no index signature.
build/typescript/walker.ts(400,53): error TS2339: Property 'Export' does not exist on type 'typeof NodeFlags'.
build/typescript/walker.ts(422,53): error TS2339: Property 'Export' does not exist on type 'typeof NodeFlags'.
[11:45:06] build-tools - Failed
Error: libjass@0.12.0 build: `tsc -p ./build/tsconfig.json`
Exit status 2
    at EventEmitter.<anonymous> (C:\Users\X4\AppData\Roaming\npm\node_modules\npm\lib\utils\lifecycle.js:279:16)
    at emitTwo (events.js:106:13)
    at EventEmitter.emit (events.js:192:7)
    at ChildProcess.<anonymous> (C:\Users\X4\AppData\Roaming\npm\node_modules\npm\lib\utils\spawn.js:40:14)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:192:7)
    at maybeClose (internal/child_process.js:890:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)

What I do wrong? And can you improve instructions in README.md by adding build sections with example how you do building?

Arnavion commented 7 years ago

You've somehow installed typescript that is newer than 2.0.10, because the things in the errors were removed in 2.1. I cannot repro because npm install typescript will still respect package.json and install 2.0.10, so seems you did something else.

Also, it's a normal npm package. You just need to run one npm install to install all the dependencies and run the build script. No need to install each dependency individually.

Then if you make changes to the source you can rebuild with node ./build.js clean default or whatever targets you want (see build.js to get all the targets).

XCanG commented 7 years ago

Oh, running npm install create so many folders (193) in node_modules and automatically run building. It build now but with some warnings

D:\Docs\libjass-master>npm install
npm WARN deprecated minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue

> intern@3.4.3 install D:\Docs\libjass-master\node_modules\intern
> node support/fixdeps.js

npm WARN prepublish-on-install As of npm@5, `prepublish` scripts will run only for `npm publish`.
npm WARN prepublish-on-install (In npm@4 and previous versions, it also runs for `npm install`.)
npm WARN prepublish-on-install See the deprecation note in `npm help scripts` for more information.

> libjass@0.12.0 prepublish D:\Docs\libjass-master
> node ./build.js clean default

[17:46:32] clean - Starting
[17:46:32] clean - Succeeded
[17:46:32] build-tools - Starting
[17:46:32] version.ts - Starting
[17:46:32] version.ts - Succeeded
[17:46:32] build-tools - Succeeded
[17:46:32] libjass.js - Starting
Compiling src\tsconfig.json...
Compile succeeded.
[17:46:37] libjass.js - Succeeded
[17:46:37] libjass.min.js - Starting
[17:46:39] libjass.min.js - Succeeded
[17:46:39] default - Starting
[17:46:39] default - Succeeded
libjass@0.12.0 D:\Docs\libjass-master
+-- async@1.5.2

... big list of folders

But I have js and css files into \lib now, so all is ok?

Arnavion commented 7 years ago

Yes, warnings from npm install don't matter.

XCanG commented 7 years ago

Ok. Issue may be closed.

P.S. add that command (npm install) in guide (Readme.md). I think it will help for people, who don't know how to build.