Note that there are some explanatory texts on larger screens.

plurals
  1. POnpm install fails when package is a dependency
    text
    copied!<p>I am building an npm package (<code>libsbmlsim</code>) that installs binaries that I will later be using server side.</p> <p>The package builds just fine when I run <code>npm install</code>, however, when I use it as a dependency in a different project via <code>npm install libsbmlsim</code>, it fails to find one of the binaries that it depends on (<code>cmake</code>):</p> <pre><code>/bin/sh: ../../node_modules/cmake/bin/cmake: No such file or directory make: *** [all] Error 127 npm ERR! libsbmlsim@0.0.2 install: `make` npm ERR! `sh "-c" "make"` failed with 2 npm ERR! npm ERR! Failed at the libsbmlsim@0.0.2 install script. </code></pre> <p>I suspect it has to do with my setup, so I will explain it a bit here. <code>libsbmlsim</code> depends on a few other binaries (<code>cmake</code> and <code>libsbml</code>), that I also have as bundled as npm packages which I bring in as dependencies or <code>npm install cmake</code> etc. I set the install script in the package.json files of each package to run <code>make</code>, and I have a corresponding <code>Makefile</code> that downloads the binaries. </p> <p>Again, this works when I run <code>npm install</code> when I have <code>libsbmlsim</code> as its own project but it fails to install when it is installed as a dependency, i.e. <code>npm install libsbmlsim</code>.</p> <p>Here is my Makefile:</p> <pre><code>all: wget http://fun.bio.keio.ac.jp/software/libsbmlsim/downloads/libsbmlsim-1.1.0.tar.gz tar -xvzf libsbmlsim-1.1.0.tar.gz mkdir -p libsbmlsim-1.1.0/build cd libsbmlsim-1.1.0/build; export PATH=../../node_modules/cmake/bin:$(PATH); cmake .. -DCMAKE_INSTALL_PREFIX=../../libsbmlsim -DLIBSBML_INCLUDE_DIR=../../node_modules/libsbml/include -DLIBSBML_LIBRARY=../../node_modules/libsbml/lib64/libsbml.so cd libsbmlsim-1.1.0/build; export PATH=../../node_modules/cmake/bin:$(PATH); make -j4 cd libsbmlsim-1.1.0/build; make install; rm -rf libsbmlsim-1.1.0 rm *.tar.gz </code></pre> <p>Source is available here: <a href="https://github.com/stanley-gu/libsbmlsim" rel="nofollow">https://github.com/stanley-gu/libsbmlsim</a></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload