# Recommended way to install/modify/run ProseMirror?

**URL:** <https://discuss.prosemirror.net/t/recommended-way-to-install-modify-run-prosemirror/311>\
**Category:** Uncategorized\
**Created:** [May 15, 2016, 7:46pm UTC](https://discuss.prosemirror.net/t/recommended-way-to-install-modify-run-prosemirror/311 "2016-05-15T19:46:25Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![lhl](https://discuss.prosemirror.net/user_avatar/discuss.prosemirror.net/lhl/32/178_2.png) [@lhl](https://discuss.prosemirror.net/u/lhl)\
**Post date:** [May 15, 2016, 7:46pm UTC](https://discuss.prosemirror.net/t/recommended-way-to-install-modify-run-prosemirror/311/1 "2016-05-15T19:46:25Z")

</div>

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](https://prosemirror.net/guide/basics.html). 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):

```auto
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):

```auto
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](https://prosemirror.net/demo/basic.html) serve a static bundle. Again the [guide](https://prosemirror.net/guide/basics.html) 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`?

```auto
 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?

---

<div class="post-metadata">

**Author:** ![marijn](https://discuss.prosemirror.net/user_avatar/discuss.prosemirror.net/marijn/32/15_2.png) [@marijn](https://discuss.prosemirror.net/u/marijn)\
**Post date:** [May 17, 2016, 12:04pm UTC](https://discuss.prosemirror.net/t/recommended-way-to-install-modify-run-prosemirror/311/2 "2016-05-17T12:04:49Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![lhl](https://discuss.prosemirror.net/user_avatar/discuss.prosemirror.net/lhl/32/178_2.png) [@lhl](https://discuss.prosemirror.net/u/lhl)\
**Post date:** [May 17, 2016, 9:20pm UTC](https://discuss.prosemirror.net/t/recommended-way-to-install-modify-run-prosemirror/311/3 "2016-05-17T21:20:17Z")

</div>

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](https://discuss.prosemirror.net/t/example-of-using-prosemirror-in-a-browser/106) 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](https://github.com/lhl/pensieve/tree/master/js)

---

<div class="post-metadata">

**Author:** ![marijn](https://discuss.prosemirror.net/user_avatar/discuss.prosemirror.net/marijn/32/15_2.png) [@marijn](https://discuss.prosemirror.net/u/marijn)\
**Post date:** [May 18, 2016, 7:41am UTC](https://discuss.prosemirror.net/t/recommended-way-to-install-modify-run-prosemirror/311/4 "2016-05-18T07:41:14Z")

</div>

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.
