[MacPorts] #48127: npm 2.11.2 fails user prefix build
#48127: npm 2.11.2 fails user prefix build ---------------------+-------------------------------- Reporter: mtb19@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.3.3 Keywords: | Port: npm ---------------------+-------------------------------- From `main.log` (complete file attached): {{{ ... :info:destroot > node bin/npm-cli.js prune --prefix=. --no-global && rimraf test/*/*/node_modules && make -j4 doc :info:destroot :info:destroot sh: rimraf: command not found :info:destroot :info:destroot npm ERR! addLocalDirectory Could not pack [[PREFIX]]/var/macports/build/[[PREFIX]]_var_macports_sources_rsync.macports.org_release_tarballs_ports _devel_npm/npm/work/package to [[PREFIX]]/var/macports/build/[[PREFIX]]_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_npm/npm/work/.home/ .npm/npm/2.11.2/package.tgz :info:destroot npm ERR! addLocal Could not install [[PREFIX]]/var/macports/build/[[PREFIX]]_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel _npm/npm/work/package :info:destroot npm ERR! Darwin 13.4.0 :info:destroot npm ERR! argv "[[PREFIX]]/bin/node" "[[PREFIX]]/var/macports/build/[[PREFIX]]_var_macports_sources_rsync.macports.org_release_tarballs_ports_deve l_npm/npm/work/package/cli.js" "install" "--global" "." "-- prefix=[[PREFIX]]/var/macports/build/[[PREFIX]]_var_macports_sources_rsync.macports.org_release_tarba lls_ports_devel_npm/npm/work/destroot[[PREFIX]]" :info:destroot npm ERR! node v0.12.4 :info:destroot npm ERR! npm v2.11.2 :info:destroot npm ERR! file sh :info:destroot npm ERR! code ELIFECYCLE :info:destroot npm ERR! errno ENOENT :info:destroot npm ERR! syscall spawn :info:destroot npm ERR! npm@2.11.2 prepublish: `node bin/npm-cli.js prune --prefix=. --no-global && rimraf test/*/*/node_modules && make -j4 doc` :info:destroot npm ERR! spawn ENOENT :info:destroot npm ERR! :info:destroot npm ERR! Failed at the npm@2.11.2 prepublish script 'node bin/npm-cli.js prune --prefix=. --no-global && rimraf test/*/*/node_modules && make -j4 doc'. :info:destroot npm ERR! This is most likely a problem with the npm package, :info:destroot npm ERR! not with npm itself. :info:destroot npm ERR! Tell the author that this fails on your system: :info:destroot npm ERR! node bin/npm-cli.js prune --prefix=. --no- global && rimraf test/*/*/node_modules && make -j4 doc :info:destroot npm ERR! You can get their info via: :info:destroot npm ERR! npm owner ls npm :info:destroot npm ERR! There is likely additional logging output above. :info:destroot :info:destroot npm ERR! Please include the following file with any support request: :info:destroot npm ERR! [[PREFIX]]/var/macports/build/[[PREFIX]]_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_npm/npm/work/package /npm-debug.log :info:destroot Command failed: cd "[[PREFIX]]/var/macports/build/[[PREFIX]]_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_npm/npm/work/package" && [[PREFIX]]/bin/node ./cli.js install --global . --prefix=[[PREFIX]]/var/macports/build/[[PREFIX]]_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_npm/npm/work/destroot[[PREFIX]] :info:destroot Exit code: 1 :error:destroot org.macports.destroot for port npm returned: command execution failed :debug:destroot Error code: CHILDSTATUS 28393 1 :debug:destroot Backtrace: command execution failed while executing "system -nice 0 $fullcmdstring" ("eval" body line 1) invoked from within "eval system $notty $nice \$fullcmdstring" invoked from within "command_exec destroot" (procedure "portdestroot::destroot_main" line 2) invoked from within "portdestroot::destroot_main org.macports.destroot" ("eval" body line 1) invoked from within "eval $procedure $targetname" :info:destroot Warning: targets not executed for npm: org.macports.activate org.macports.destroot org.macports.install :notice:destroot Please see the log file for port npm for details: [[PREFIX]]/var/macports/logs/[[PREFIX]]_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_npm/npm/main.log }}} -- Ticket URL: <https://trac.macports.org/ticket/48127> MacPorts <https://www.macports.org/> Ports system for OS X
#48127: npm 2.11.2 fails user prefix build ----------------------+-------------------------------- Reporter: mtb19@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.3.3 Resolution: | Keywords: Port: npm | ----------------------+-------------------------------- Comment (by ryandesign@…): On my normal root MacPorts installation, I get: {{{ npm WARN cannot run in wd npm@2.11.3 node bin/npm-cli.js prune --prefix=. --no-global && rimraf test/*/*/node_modules && make -j4 doc (wd=/opt/local/var/macports/build/_Users_rschmidt_macports_dports_devel_npm/npm/work/package) }}} I don't know why it cannot run the command on my system but does attempt to do so on your system, but I also don't know why the npm build wants to run the command at all. Certainly, it would not be right to try to run the `rimraf` command when that command does not exist. (`rimraf` is a cross- platform implementation of `rm -rf`.) This command line appears in npm's package.json in the `prepublish` key. We're just asking to install npm, not publish anything, so I don't understand why a prepublish step is being run, but maybe I don't know what npm means by "publish". In any case, it sounds like a mistake in the npm build system, which you should report to the developers of npm. -- Ticket URL: <https://trac.macports.org/ticket/48127#comment:2> MacPorts <https://www.macports.org/> Ports system for OS X
#48127: npm 2.11.2 fails user prefix build ----------------------+-------------------------------- Reporter: mtb19@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.3.3 Resolution: | Keywords: Port: npm | ----------------------+-------------------------------- Comment (by mtb19@…): For kicks, I created `[[PREFIX]]/bin/rimraf` as follows: {{{ #!/usr/bin/env sh set -ex echo "${0}" exec rm -fr ${1+"${@}"} }}} Then I ran `port clean --all npm && port install npm`. It "worked" (new main.log attached). I'm curious why @ryandesign's build would find `rimraf` (and where), but mine wouldn't. Could this be solved by temporarily augmenting `PATH` during the build process? For what it's worth, I can install a localized `npm` into `${HOME}/.npm` ([http://www.johnpapa.net/how-to-use-npm-global-without-sudo-on-osx/ per these instructions]) without issue, so I'm not sure it's an upstream packaging issue? It might be, but I doubt I'll get much traction there. -- Ticket URL: <https://trac.macports.org/ticket/48127#comment:3> MacPorts <https://www.macports.org/> Ports system for OS X
#48127: npm 2.11.2 fails user prefix build ----------------------+-------------------------------- Reporter: mtb19@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.3.3 Resolution: | Keywords: Port: npm | ----------------------+-------------------------------- Comment (by ryandesign@…): `rimraf` doesn't exist; npm should not be attempting to run it. The root build doesn't attempt to run the command, while your non-root build does; I don't know why. -- Ticket URL: <https://trac.macports.org/ticket/48127#comment:4> MacPorts <https://www.macports.org/> Ports system for OS X
#48127: npm 2.11.2 fails user prefix build ----------------------+-------------------------------- Reporter: mtb19@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.3.3 Resolution: | Keywords: Port: npm | ----------------------+-------------------------------- Comment (by mtb19@…): Ah, okay. Sorry for misunderstanding. I now understand what you're referring to with the `prepublish` phase (from `package.json`). After some investigation, I'm pretty sure @ryandesign is right that this is an `npm` issue: [https://github.com/npm/npm/issues/7040 npm/npm#7040] Please feel free to close. I will continue to investigate and possibly reopen if a fix for that issue does not resolve the problem described in the OP. -- Ticket URL: <https://trac.macports.org/ticket/48127#comment:5> MacPorts <https://www.macports.org/> Ports system for OS X
#48127: npm 2.11.2 fails user prefix build ----------------------+-------------------------------- Reporter: mtb19@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.3.3 Resolution: | Keywords: Port: npm | ----------------------+-------------------------------- Comment (by apowers313@…): Having the same problem with rimraf not existing when installing as a non- root user into an alternate MacPorts directory. Was a solution ever found? -- Ticket URL: <https://trac.macports.org/ticket/48127#comment:6> MacPorts <https://www.macports.org/> Ports system for OS X
participants (1)
-
MacPorts