# pkg install - Force www/npm to use lang/node010



## tuaris (Jun 16, 2015)

I have www/node010 installed using pkg.  If I install www/npm, then www/node010 gets removed and www/node gets installed:


```
pkg install -y npm
Updating FreeBSD repository catalogue...
FreeBSD repository is up-to-date.
All repositories are up-to-date.
Checking integrity... done (1 conflicting)
Checking integrity... done (0 conflicting)
The following 3 package(s) will be affected (of 0 checked):

Installed packages to be REMOVED:
  node010-0.10.38_2

New packages to be INSTALLED:
  npm: 2.11.1
  node: 0.12.4

The process will require 12 MiB more space.
[1/3] Deinstalling node010-0.10.38_2...
[1/3] Deleting files for node010-0.10.38_2: 100%
[2/3] Installing node-0.12.4...
[2/3] Extracting node-0.12.4: 100%
[3/3] Installing npm-2.11.1...
[3/3] Extracting npm-2.11.1: 100%
Message for node-0.12.4:
Note: If you need npm (Node Package Manager), please install www/npm.
```

If I re-install www/node010, www/npm gets removed:


```
pkg install -y node010
Updating FreeBSD repository catalogue...
FreeBSD repository is up-to-date.
All repositories are up-to-date.
Checking integrity... done (1 conflicting)
Checking integrity... done (0 conflicting)
The following 3 package(s) will be affected (of 0 checked):

Installed packages to be REMOVED:
  node-0.12.4
  npm-2.11.1

New packages to be INSTALLED:
  node010: 0.10.38_2

The operation will free 12 MiB.
[1/3] Deinstalling npm-2.11.1...
[1/3] Deleting files for npm-2.11.1: 100%
[2/3] Deinstalling node-0.12.4...
[2/3] Deleting files for node-0.12.4: 100%
[3/3] Installing node010-0.10.38_2...
[3/3] Extracting node010-0.10.38_2: 100%
Message for node010-0.10.38_2:
Note: If you need npm (Node Package Manager), please install www/npm.
```

Is it possible to have www/node010 and www/npm installed with packages without using ports and without having to setup my own pkg repository?


----------



## hukadan (Jun 16, 2015)

No it is not. You need to use ports and select the *NODE010* option of the www/npm port. Packages are only available with default options. If you want to change them, the only way is to use ports.


----------



## junovitch@ (Jun 17, 2015)

From looking at the pkg-plist files, they both install same /usr/local/bin/node.  If you need them to coexist, an alternative is to consider using a jail for the current version of node and a jail for the legacy version of node.


----------



## hukadan (Jun 17, 2015)

Thank you junovitch for your alternative solution. But I think I am missing a step. If I understood well the solution you propose, I would end up with a jail (the one with the legacy version of node) without www/npm. How would I do to use www/npm on that jail to install node packages ?


----------



## junovitch@ (Jun 18, 2015)

hukadan said:


> Thank you junovitch for your alternative solution. But I think I am missing a step. If I understood well the solution you propose, I would end up with a jail (the one with the legacy version of node) without www/npm. How would I do to use www/npm on that jail to install node packages ?



My original comment only accounts for having a www/node in one jail and a www/node010 in another jail to get around the fact they both install a /usr/local/bin/node.  I'm not a node user, so I see that my advise was certainly incomplete.  Sorry about that.  Looking at the port options, www/npm does indeed have options for each different node backend.  There doesn't seem to be any way around compiling with custom options for www/npm.


----------

