felixhao28/JSCPP

Mac npm install error

binchen1998 opened this issue · 9 comments

Hi,

On my mac os, after checking out and npm install, it shows the errors:

`Running "browserify:dist" (browserify) task

Error: Can't walk dependency graph: Cannot find module './ast' from '/Users/binchen/git/JSCPP/lib/launcher.js'
required by /Users/binchen/git/JSCPP/lib/launcher.js
Warning: Error running grunt-browserify. Use --force to continue.

Aborted due to warnings.
npm ERR! code ELIFECYCLE
npm ERR! errno 6
npm ERR! JSCPP@2.0.8 prepublish: grunt build
npm ERR! Exit status 6
npm ERR!
npm ERR! Failed at the JSCPP@2.0.8 prepublish 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/binchen/.npm/_logs/2020-10-20T00_39_14_925Z-debug.log
`

Can you take a look?
Thanks.

2020-10-20T00_39_14_925Z-debug.log

Update: after I re-run the npm install, seems the build is successful, but open demo/index.html it shows:
TypeError: JSCPP.run is not a function

The prior error is caused by ast.js and prepast.js is inside src/ but not lib/. However the other file requires them to be in lib/.(seems like order of the build script is broken). When second run ast.js and prepast.js are already copied to lib/, so the build is successful.

But seems like the result bundle file is still not right.

Update: On Windows the error is exactly the same.

I recently rewrote the whole project with TypeScript and that might have broken something. While I am working on a fix, you can use the previously built file.

It actually turns out to be a very trivial problem. @binchen1998 try again and it should be fixed.

Hi, thanks for your reply.
The build is ok now, but the result file still has problem.

TypeError: Cannot read property 't' of undefined

Thanks.

Detailed info:
Uncaught TypeError: Cannot read property 't' of undefined at JSCPP.es5.min.js:1 at JSCPP.es5.min.js:1 at Object.next (JSCPP.es5.min.js:1) at JSCPP.es5.min.js:1 at Object.next (JSCPP.es5.min.js:1) at JSCPP.es5.min.js:1 at Object.next (JSCPP.es5.min.js:1) at JSCPP.es5.min.js:1 at Object.next (JSCPP.es5.min.js:1) at JSCPP.es5.min.js:1

TypeError: Cannot read property 't' of undefined

Same here, using Node v12.19.0 on macOS.

It was a browserify lacking babel-polyfill issue. I don't know why it wasn't an issue earlier. Anyway, it is fixed now. @binchen1998 @rodrigorgs

Thanks. It's ok now!