Bug 225562 - www/npm: cannot execute node-gyp
Summary: www/npm: cannot execute node-gyp
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: Po-Chuan Hsieh
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-01-30 13:43 UTC by Bradley T. Hughes
Modified: 2018-02-19 10:04 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (sunpoet)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bradley T. Hughes freebsd_committer freebsd_triage 2018-01-30 13:43:14 UTC
I've installed the latest npm (5.6.0_1) and am trying to build a native module, but it fails when executing node-gyp:

$ npm i unix-dgram

> unix-dgram@2.0.1 install /usr/home/bhughes/asdf/node_modules/unix-dgram
> node-gyp rebuild

sh: node-gyp: Permission denied

This is because the node-gyp executables do not have the x bit set:

$ ll /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin/node-gyp
-rw-r--r--  1 root  wheel  - 3596 Dec 15 12:44 /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js
-rw-r--r--  1 root  wheel  -  172 Nov 28 03:37 /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin/node-gyp

Setting +x manually on both of these files allows me to build native modules again.
Comment 1 Po-Chuan Hsieh freebsd_committer freebsd_triage 2018-02-18 13:39:22 UTC
Committed. Thanks!
Comment 2 commit-hook freebsd_committer freebsd_triage 2018-02-18 13:39:22 UTC
A commit references this bug:

Author: sunpoet
Date: Sun Feb 18 13:38:52 UTC 2018
New revision: 462245
URL: https://svnweb.freebsd.org/changeset/ports/462245

Log:
  Fix permission of node-gyp

  - Bump PORTREVISION for package change

  PR:		225562
  Submitted by:	bhughes
  MFH:		2018Q1

Changes:
  head/www/npm/Makefile
  head/www/npm/pkg-plist
Comment 3 commit-hook freebsd_committer freebsd_triage 2018-02-19 10:04:46 UTC
A commit references this bug:

Author: sunpoet
Date: Mon Feb 19 10:03:55 UTC 2018
New revision: 462287
URL: https://svnweb.freebsd.org/changeset/ports/462287

Log:
  MFH: r462245

  Fix permission of node-gyp

  - Bump PORTREVISION for package change

  PR:		225562
  Submitted by:	bhughes

  Approved by:	ports-secteam (riggs)

Changes:
_U  branches/2018Q1/
  branches/2018Q1/www/npm/Makefile
  branches/2018Q1/www/npm/pkg-plist