Node not finding Less module

旧时模样 提交于 2019-12-01 18:13:57

You should create symlink to node modules directory into your home directory.

$ ln -s /usr/lib/node_modules/ ~/.node_libraries

(if you installed node from source it'll be /usr/local/lib/node_modules)

Modules installed in the "global scope" (which is what happens when you use npm -g install or install node modules from Ubuntu repositories, for example - sudo apt-get install node-less) are loaded by populating the NODE_PATH environment variable.

Packages installed from Ubuntu repositories handle this automatically, but if you install manually you have to set this yourself. In your case, you'd need to add the following command to your .bash_profile:

export NODE_PATH="$NODE_PATH:/usr/local/lib/node_modules"
sudo ln -s /etc/alternatives/node /usr/local/bin/node

It works at my Ubuntu 13.04

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!