Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1530833

Summary: npm prune --production fails
Product: Red Hat Software Collections Reporter: Vasil Velichkov <vvvelichkov>
Component: rh-nodejs8Assignee: Zuzana Svetlikova <zsvetlik>
Status: CLOSED ERRATA QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rh-nodejs8CC: akhaitov, jorton, kanderso, zsvetlik
Target Milestone: ---   
Target Release: 3.1   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Cause: Upstream introduced bug in 5.3.0 release of npm Consequence: npm is unable to delete devDependencies from project's dependency tree Fix: Fix is available in npm >= 5.4.0 (nodejs >= 8.7.0) Result: npm is able to delete unnecessary modules from node_modules directory
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-02-14 12:35:05 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Vasil Velichkov 2018-01-04 01:01:10 UTC
Description of problem:

`npm prune --production` fails when devDependencies contain bins

Version-Release number of selected component (if applicable):

rh-nodejs8-npm-5.3.0-8.6.0.1.el7.x86_64.rpm

Steps to Reproduce:
1. git clone https://github.com/sclorg/s2i-nodejs-container.git
2. cd s2i-nodejs-container/test/test-app
3. npm install
4. npm prune --production 

Actual results:

$ npm prune --production
npm WARN node-echo.1 No license field.

npm ERR! May not delete: /opt/app-root/src/s2i-nodejs-container/test/test-app/node_modules/.bin

npm ERR! A complete log of this run can be found in:
npm ERR!     /opt/app-root/src/.npm/_logs/2018-01-04T00_53_47_527Z-debug.log

Expected results:

$ npm prune --production
npm WARN package.json node-echo.1 No license field.
unbuild abbrev.1
unbuild ansi-align.0
unbuild ansi-regex.0
unbuild ansi-styles.0
unbuild anymatch.2
unbuild arr-diff.0
unbuild arr-flatten.0
.....

Additional info:

This bug has already been fixed in npm version 5.4 (distributed with node.js 8.7.0).

* https://github.com/npm/npm/issues/17781
* https://github.com/npm/npm/pull/17919

Comment 7 errata-xmlrpc 2018-02-14 12:35:05 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2018:0318