[MacPorts] #32456: npm executable not found after installing nodejs port

MacPorts noreply at macports.org
Thu Dec 8 19:28:48 PST 2011


#32456: npm executable not found after installing nodejs port
---------------------------------+------------------------------------------
  Reporter:  conradwt@…          |       Owner:  ciserlohn@…           
      Type:  defect              |      Status:  new                   
  Priority:  Normal              |   Milestone:                        
 Component:  ports               |     Version:  2.0.3                 
Resolution:                      |    Keywords:  haspatch              
      Port:  nodejs, npm         |  
---------------------------------+------------------------------------------
Changes (by ryandesign@…):

  * keywords:  => haspatch


Comment:

 It seems that for some reason, on your system, npm is getting installed
 directly to /opt/local/lib/node_modules, bypassing the destroot.

 The port is installing npm by the following mechanism:
 {{{
 system -W ${destroot}${prefix}/lib "${prefix}/bin/node
 ${worksrcpath}/cli.js install ${worksrcpath}"
 }}}
 This relies on npm's behavior of creating a node_modules directory inside
 the current directory (${destroot}${prefix}/lib) and installing things
 there -- but only if a node_modules directory is not found in any parent
 directory. You showed in your transcript that you deleted the node_modules
 directory and yet it still happened. And I cannot reproduce it even if I
 create a node_modules directory beforehand. But I still suspect the
 problem relates to this.

 I've attached [attachment:npm.destroot.diff a patch] which simplifies the
 destroot considerably by switching to use npm's own global install
 mechanism, and telling it explicitly where we want files to go. The global
 switch also tells npm to install programs and manpage symlinks, so we no
 longer need to do that manually. This patch works for me, but since I was
 never able to reproduce the problem, can you test the patch and see if it
 resolves it for you? You will have to run the "sudo rm -rf" command from
 above again first or you will run into the same activation error.

-- 
Ticket URL: <https://trac.macports.org/ticket/32456#comment:12>
MacPorts <http://www.macports.org/>
Ports system for Mac OS


More information about the macports-tickets mailing list