Recommended way to install/modify/run ProseMirror?

I’ve been out of it the past couple years as far as FE dev goes, so having a bit of a problem following the install guide. The guide simply says to run npm install prosemirror, but doesn’t seem to give me something usable? (I gave up on the npm module, as once I run that, and run npm install in the prosemirror folder it gives me the following error when I try to npm run dist (I am on Arch Linux w/ node 6.1.0 and npm 3.9.0):

path.js:1142
          cwd = process.cwd();
                        ^

Error: ENOENT: no such file or directory, uv_cwd
    at Error (native)
    at Object.resolve (path.js:1142:25)
    at Function.Module._resolveLookupPaths (module.js:359:17)
    at Function.Module._resolveFilename (module.js:429:31)
    at Function.Module._load (module.js:386:25)
    at Module.require (module.js:466:17)
    at require (internal/module.js:20:19)
    at /usr/lib/node_modules/npm/bin/npm-cli.js:25:13
    at Object.<anonymous> (/usr/lib/node_modules/npm/bin/npm-cli.js:75:3)
    at Module._compile (module.js:541:32)

I am able to install ProseMirror via Bower (1.7.9):

bower install prosemirror
cd bower_components/prosemirror
npm install
npm run dist
npm run demo

This gives me working code in dist and runs the demo server on http://localhost:8080/. I can leave npm run dist-watch running and it’ll transpile automatically when I edit the src files, so so far so good.

The part I’m trying to figure out is that the localhost demo seems to serve a bundle via /moduleserve/load.js and the online demos serve a static bundle. Again the guide talks about bundling, but I’m not exactly sure how the Makefile works in the site, and there doesn’t seem to be instructions for bundling directly against the repo.

Am I supposed to simple run this in dist?

 browserify */*.js --outfile bundle.js

This seems to make a 5.4MiB file. Is this correct? Is there a different/better way to require modules directly from dist? (also something that saves the bundling process while I’m developing?)

Also, is using the bower_components folder in the htdocs of my project the appropriate way to go? Once I begin making modifications to src, should I consider this ‘forked’ or am I able to continue to use Bower to run upgrades?

That stack trace seems to point at a seriously screwed-up node.js install, and is probably not related to ProseMirror. Bower installations are not something I support or can help with. Try reading a little about browserify before using it. You pass it a root module, not a wildcard matching all source files – it’ll intelligently follow and include dependencies from the root module.

With a reinstall of node/npm and clean node_modules I am able to replicate the error (this happens only w/ the prosemirror package and not other node packages), but I’m not an node expert so if no one else has reported problems, then ¯\_(ツ)_/¯.

I was able to work around the issue by using the package.json from this thread which pulls directly from the git repo, so if using npm is preferred over bower, that’s what I’ll use.

For those interested, here’s how I ended up building the prosemirror code: https://github.com/lhl/pensieve/tree/master/js

Searching for that error yields several situations where it happened when the directory from which node was ran was deleted. But I don’t see how that could be happening here. I’ll try to install Node 6 sometime and see if I can reproduce the problem.