Closed talmobi closed 8 years ago
It sounds like you don't have a NODE_PATH
variable set to wherever your modules are installed globally. You should be able to fix this by adding a line like the following to your ~/.bashrc
(or ~/.zshrc
or whatever) file:
export NODE_PATH=/path/to/your/node/lib/node_modules
...where you can find /path/to/your/node/
with npm get prefix
. Alternatively, you can do it in the command itself like so:
export NODE_PATH=`npm get prefix`/lib/node_modules && rollup -c -w
Alternatively, there's no real harm in installing it locally – I just prefer installing this sort of thing locally since it's not used in CI builds etc.
Yes you were absolutely right! Thank you for the great explanation and insight!
ls $NODE_PATH
babel electron-prebuilt jshint npm rollup-watch webpack
browserify grunt-cli madge react-tools stylus
brunch jscs node-libs-browser rollup typescript
rollup -cw
rollup --watch depends on the rollup-watch package, which could not be found. You can install it globally (recommended) with npm install -g rollup-watch
@Rich-Harris Any insight on this similar issue? I can only get it to work if I install rollup-watch
locally as well.
I'm experiencing the same issue.
I had this issue as NODE_PATH
wasn't set. It isn't a problem I've encountered before so perhaps it would be good if rollup-watch could resolve the path itself?
@speg I have the same issue.
Mac-mini% echo $NODE_PATH
/usr/local/lib/node_modules
Mac-mini% rollup -cw
rollup --watch depends on the rollup-watch package, which could not be found. You can install it globally (recommended) with npm install -g rollup-watch
Type rollup --help for help, or visit https://github.com/rollup/rollup/wiki
Mac-mini%
Hey,
TL;DR -- rollup can't find globally installed rollup-watch (it finds locally installed ones though)
rollup (global) doesn't use the globally installed rollup-watch (says it doesn't exists and prints a recommendation to install it globally, even if it is). After I installed it locally it started to work.
Steps to reproduce: