Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NPM Modules Installed in Local Directory #38

Open
Bluejay47 opened this issue Sep 24, 2018 · 0 comments
Open

NPM Modules Installed in Local Directory #38

Bluejay47 opened this issue Sep 24, 2018 · 0 comments

Comments

@Bluejay47
Copy link

npm.install() seems to install modules in the user directory. Is there some way in pixiedust_node to refer to modules installed in the same directory as the notebook file or control the installation location of npm.install()?

@Bluejay47
Copy link
Author

It turned out to be pretty trivial to enable this in the code by doing something along the lines of

# Node home directory
        if hasattr(NodeBase, 'node_local') and NodeBase.node_local == True:
            self.node_home = os.getcwd()  
        else:
            self.node_home = os.path.join(home, 'node')
            if not os.path.exists(self.node_home):
                os.makedirs(self.node_home)

...although I haven't tried to figure out how to pass in the value to enable the local directory use at init time. Is there any interest adding this functionality? I could make an attempt to implement something and make a pull request if there is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant