Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

How to install npm when node has been compiled with prefix

How to install npm when node has been compiled with prefix

Problem

I have installed Node from source using the git repository. The current path of node is /Users/toutpt/makina/cubes/parts/nodejs/bin/node

Now I get the source of npm and I can't specify at install tho use this node. Every google results point me out to link it from /usr/bin/node or to add /Users/toutpt/makina/cubes/parts/nodejs/bin as part of global PATH

All my try give me the same error: bin/npm: line 5: node: command not found

I don't want and I can't make it global on my system because of system restriction. I would like to have each project use it's own version of node so of NPM.

I want to use npm by using it's path: /Users/toutpt/makina/cubes/parts/npm/bin/npm install ...

Problem courtesy of: toutpt

Solution

As your use-case is:

I would like to have each project use it's own version of node so of NPM

Maybe a node version management software ala n (https://github.com/visionmedia/n) or nvm (github.com/creationix/nvm) would be useful for you.

Solution courtesy of: weemonger

Discussion

View additional discussion.



This post first appeared on Node.js Recipes, please read the originial post: here

Share the post

How to install npm when node has been compiled with prefix

×

Subscribe to Node.js Recipes

Get updates delivered right to your inbox!

Thank you for your subscription

×