plasma-umass / doppio

Breaks the browser language barrier (includes a plugin-free JVM).
http://plasma-umass.github.io/doppio-demo
MIT License
2.16k stars 174 forks source link

npm install failed #482

Closed cool2man closed 7 years ago

cool2man commented 7 years ago

"npm install" failed with the following information:

npm ERR! Darwin 16.1.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install"
npm ERR! node v4.4.5
npm ERR! npm  v2.15.5
npm ERR! code ELIFECYCLE
npm ERR! doppiojvm@0.4.2 prepublish: `node ./prepublish.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the doppiojvm@0.4.2 prepublish script 'node ./prepublish.js'.
npm ERR! This is most likely a problem with the doppiojvm package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node ./prepublish.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs doppiojvm
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! 
npm ERR!     npm owner ls doppiojvm
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/coolman/Development/doppio/npm-debug.log

The log file is attached

npm-debug.log.zip

jvilk commented 7 years ago
96411 info doppiojvm@0.4.2 Failed to exec prepublish script
96412 verbose stack Error: doppiojvm@0.4.2 prepublish: `node ./prepublish.js`
96412 verbose stack Exit status 1
96412 verbose stack     at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:217:16)
96412 verbose stack     at emitTwo (events.js:87:13)
96412 verbose stack     at EventEmitter.emit (events.js:172:7)
96412 verbose stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:24:14)
96412 verbose stack     at emitTwo (events.js:87:13)
96412 verbose stack     at ChildProcess.emit (events.js:172:7)
96412 verbose stack     at maybeClose (internal/child_process.js:827:16)
96412 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)

The install procedure assumes that node is installed to your system's path. Are you on Debian? You may need to install the nodejs-legacy package.

cool2man commented 7 years ago

I am on MacOS Sierra. node is available at /usr/local/bin which is in $PATH.

For me it seems that "includes/JVMTypes.d.ts" is missing.

Some of my console output:

Running "ts:dev-cli" (ts) task
Compiling...
Using tsc v2.0.3
console/doppioh.ts(23,27): error TS2307: Cannot find module '../includes/JVMTypes'.
console/doppioh.ts(24,26): error TS2307: Cannot find module '../vendor/java_home/jdk.json'.
console/doppioh.ts(657,45): error TS7006: Parameter 'item' implicitly has an 'any' type.
console/find_invalid_natives.ts(15,27): error TS2307: Cannot find module '../includes/JVMTypes'.
console/find_invalid_natives.ts(17,26): error TS2307: Cannot find module '../vendor/java_home/jdk.json'.

…

Running "includes:default" (includes) task
Fatal error: Could not run doppioh (exit code 1): Error: /Users/coolman/Development/doppio/node_modules/browserfs/dist/browserfs.js:14842
    Buffer.from = function (value, encodingOrOffset, length) {
                ^

TypeError: Cannot assign to read only property 'from' of function Buffer(arg, encodingOrOffset, length) {
      // Common case.
      if (typeof arg === 'number') {
        if (...<omitted>... }
    at Object.<anonymous> (/Users/coolman/Development/doppio/node_modules/browserfs/dist/browserfs.js:14842:14)
    at Object.exports.byteLength (/Users/coolman/Development/doppio/node_modules/browserfs/dist/browserfs.js:16420:31)
    at _webpack_require_ (/Users/coolman/Development/doppio/node_modules/browserfs/dist/browserfs.js:30:30)
    at Object.<anonymous> (/Users/coolman/Development/doppio/node_modules/browserfs/dist/browserfs.js:14709:19)
    at _webpack_require_ (/Users/coolman/Development/doppio/node_modules/browserfs/dist/browserfs.js:30:30)
    at Object.<anonymous> (/Users/coolman/Development/doppio/node_modules/browserfs/dist/browserfs.js:14703:78)
    at _webpack_require_ (/Users/coolman/Development/doppio/node_modules/browserfs/dist/browserfs.js:30:30)
    at Object.defineProperty.value (/Users/coolman/Development/doppio/node_modules/browserfs/dist/browserfs.js:50:18)
    at /Users/coolman/Development/doppio/node_modules/browserfs/dist/browserfs.js:53:10
    at webpackUniversalModuleDefinition (/Users/coolman/Development/doppio/node_modules/browserfs/dist/browserfs.js:3:20)

/Users/coolman/Development/doppio/node_modules/browserfs/dist/browserfs.js:14842
    Buffer.from = function (value, encodingOrOffset, length) {
                ^

TypeError: Cannot assign to read only property 'from' of function Buffer(arg, encodingOrOffset, length) {
      // Common case.
      if (typeof arg === 'number') {
        if (...<omitted>... }
    at Object.<anonymous> (/Users/coolman/Development/doppio/node_modules/browserfs/dist/browserfs.js:14842:14)
    at Object.exports.byteLength (/Users/coolman/Development/doppio/node_modules/browserfs/dist/browserfs.js:16420:31)
    at _webpack_require_ (/Users/coolman/Development/doppio/node_modules/browserfs/dist/browserfs.js:30:30)
    at Object.<anonymous> (/Users/coolman/Development/doppio/node_modules/browserfs/dist/browserfs.js:14709:19)
    at _webpack_require_ (/Users/coolman/Development/doppio/node_modules/browserfs/dist/browserfs.js:30:30)
    at Object.<anonymous> (/Users/coolman/Development/doppio/node_modules/browserfs/dist/browserfs.js:14703:78)
    at _webpack_require_ (/Users/coolman/Development/doppio/node_modules/browserfs/dist/browserfs.js:30:30)
    at Object.defineProperty.value (/Users/coolman/Development/doppio/node_modules/browserfs/dist/browserfs.js:50:18)
    at /Users/coolman/Development/doppio/node_modules/browserfs/dist/browserfs.js:53:10
    at webpackUniversalModuleDefinition (/Users/coolman/Development/doppio/node_modules/browserfs/dist/browserfs.js:3:20)
/Users/coolman/Development/doppio/prepublish.js:13
    throw new Error("Program exited with code " + code);
    ^

Error: Program exited with code 1
    at checkCode (/Users/coolman/Development/doppio/prepublish.js:13:11)
    at ChildProcess.<anonymous> (/Users/coolman/Development/doppio/prepublish.js:27:5)
    at emitTwo (events.js:87:13)
    at ChildProcess.emit (events.js:172:7)
    at maybeClose (internal/child_process.js:827:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
jvilk commented 7 years ago

Whoa! Okay, that's interesting.

Also, JVMTypes.d.ts is generated in that doppioh step as part of bootstrapping. The build system (correctly) ignores type checking errors in the dev-cli step during bootstrapping. The issue is that doppioh fails for a bizarre reason.

jvilk commented 7 years ago

I just successfully ran:

git clone https://github.com/plasma-umass/doppio
cd doppio
npm install

I'm on a Mac, too (the version prior to Sierra; haven't made the jump yet!).

I have Node v6 installed, though. So does Travis. But I don't understand why that would cause an issue.

You're running this from an up-to-date clone of Doppio, right?

cool2man commented 7 years ago

I did exact the same as you tried on your Mac - all from scratch. My node is much older (4.4.5). I will check how to switch to the latest stable version...

jvilk commented 7 years ago

That's frustrating; 4 should still work. :(

That error message is completely nonsensical, though.

cool2man commented 7 years ago

Updated to v6. Same missing include - BUT its created in a later step and npm installed finished. Is this now a good or bad news? ;-)

jvilk commented 7 years ago

@cool2man this is intentional.

JVMTypes.d.ts is dynamically generated by Doppio itself. But it is also required for TypeScript to typecheck Doppio during compilation.

Rather than check that gigantic file in, we do the following the first time you compile Doppio: