documentation icon indicating copy to clipboard operation
documentation copied to clipboard

JS dependencies will not install correctly

Open blazeu opened this issue 7 years ago • 4 comments

http://docs.coala.io/en/latest/Users/Install.html#js-dependencies states that you run npm install -g to install JS dependencies, however that only installs the coala-bears globally (which is useless) not each of the dependencies stated in package.json (e.g. eslint) globally.

When running npm install -g what's actually happening is:

  • npm installs all dependencies stated in package.json locally (node_modules folder inside the project)
  • npm creates a symlink to coala-bears folder inside their 'global dependencies folder' (try npm root -g to find where it actually is)

blazeu avatar Oct 25 '17 15:10 blazeu

The solution might be to add node_modules inside the project to PATH and also set NODE_PATH like in https://github.com/coala/docker-coala-base/blob/master/Dockerfile#L10-L11

OR

Just install the dependencies interactively when running coala e.g. when coala is missing something, ask the user to install it, obviously requires fixing in coala/coala- bears

blazeu avatar Oct 25 '17 15:10 blazeu

I think I can work on this.. @blazeu I have to write something like export NODE_PATH='yourdir'/node_modules at the starting of package.json

but the PATH will be different for different machines... isn't it?

yashovardhan avatar Nov 21 '17 15:11 yashovardhan

at the starting of package.json

You can't run that inside a .json file.

I don't think you understand this.

blazeu avatar Nov 21 '17 16:11 blazeu

we have to provide environment variables NODE_PATH and PATH these values so we have to make a process.env file?

yashovardhan avatar Nov 21 '17 19:11 yashovardhan