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 from GitHub repo fails #473

Closed marcosscriven closed 7 years ago

marcosscriven commented 7 years ago

Hi

Because there are some fixes currently in the repo which haven't been released, I'm trying to install it in npm from Github:

npm install plasma-umass/doppio

This fails with the following error:

npm WARN enoent ENOENT: no such file or directory, open '/private/tmp/package.json'
npm WARN tmp No description
npm WARN tmp No repository field.
npm WARN tmp No README data
npm WARN tmp No license field.
npm ERR! Darwin 15.6.0
npm ERR! argv "/usr/local/Cellar/node/6.3.1/bin/node" "/usr/local/bin/npm" "install" "plasma-umass/doppio"
npm ERR! node v6.3.1
npm ERR! npm  v3.10.6
npm ERR! path /private/tmp/node_modules/doppiojvm/bin/doppio
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall chmod

npm ERR! enoent ENOENT: no such file or directory, chmod '/private/tmp/node_modules/doppiojvm/bin/doppio'
npm ERR! enoent ENOENT: no such file or directory, chmod '/private/tmp/node_modules/doppiojvm/bin/doppio'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! Please include the following file with any support request:
npm ERR!     /private/tmp/npm-debug.log

The full log is: npm-debug.log.txt

marcosscriven commented 7 years ago

The directories npm is trying to change perms for I think were added in package.json in this commit: https://github.com/plasma-umass/doppio/commit/5f9d4c8cabb488f292e098859e84369cbca51b72#diff-b9cfc7f2cdf78a7f4b91a753d10865a2R70

jvilk commented 7 years ago

Hmm, interesting. Thanks for the report! I will look at this more closely tomorrow, and perform an NPM release with a fix.

marcosscriven commented 7 years ago

Just to add, I've confirmed this broke in the commit I mentioned.

This works fine (the parent commit):

npm install plasma-umass/doppio#2bd98ef12f00847d2a0359f3c391ad04c7777ffd

Whereas the subsequent commit has the issue with absent bin directories:

npm install plasma-umass/doppio#5f9d4c8cabb488f292e098859e84369cbca51b72

jvilk commented 7 years ago

So, DoppioJVM isn't "ready-to-install" in the Git repository because it is not built from source. It needs to have all of its development dependencies, and then have the prepublish.js script run to compile DoppioJVM and create all of the artifacts needed.

As a compromise, I can simply add these bin scripts to the repository instead of generate them. But DoppioJVM won't "just work" when installed from Git unless you manually build it.

marcosscriven commented 7 years ago

Ah - kind of a shame, as npm install can take a GitHub name/repo argument for just this purpose. It also means you can simply specify that same GitHub reference in whatever package.json deps, and it'll just work, even if it does have to compile.

You can set your own script to run after install has installed deps, just by specifying {"scripts": {"install": "grunt release"}}, or whatever you need for the default published form.

jvilk commented 7 years ago

@marcosscriven We do have an install script; it downloads the JDK so we don't have to bundle it in our NPM package. But building DoppioJVM from source in an install script would be a huge issue for people using DoppioJVM from NPM.

Basically, it would turn all of our devdependencies into dependencies, since we need a huge amount of packages for the compilation process. Most people wouldn't want that.

I mean, we could probably detect the .git situation and recursively run npm install to pull in devDependencies? But that sounds dangerous.