npm 5.5: nested node_modules folders are ignored by pack
.
#18942
Comments
Could possibly be related to #17708? |
It looks like 9b72c4f42cf1 in |
I'm having the same problem, npm pack does not include the /node_modules directory, using npm v5.3.0 and node v8.6.0. I am also on Ubuntu |
I manually updated npm to the most recent version of As far as I know |
Awesome thanks that worked! For more details, I was trying to package the cordova node module directory located here: Using Node v8.6.0 & NPM v5.3.0, running the npm pack command skipped the node_modules directory from within the cordova directory. I was able to work around this by moving back to Node v6.11.4 & NPM v3.10.10 then running npm pack. I've also now tried danShumway's solution to update npm-packlist for NPM 5.3.0. I did this by running npm install npm-packlist. After updating, then running npm pack on the cordova node modules directory, it successfully packed everything including the node_modules directory within cordova. |
Pinging to make sure the issue doesn't get auto-closed by a bot before I get a chance to verify. From what I can tell, this will be fixed in anything post |
Tested with npm v5.6.0 and |
I'm opening this issue because:
What's going wrong?
npm pack
does not bundle nestednode_modules
. I often take advantage of Node'srequire
behavior to avoid relative paths when referencing other files and tests. I've found it to be a big help with keeping code refactorable and readable.In npm 5.3 and below this works like a charm, but somewhere before 5.5.1, npm started skipping any
node_modules
folder, even if it's not associated with apackage.json
and not in the root directory.This also impacts installs; if I try to publish a package with npm 5.5.1, the resulting package in the repo will be broken. If I publish the package with npm 5.3.0 and then install with npm 5.5.1, everything works great again.
Is this an intentional change?
How can the CLI team reproduce the problem?
supporting information:
npm -v
prints: v8.4.0node -v
prints: 5.5.1npm config get registry
prints: https://registry.npmjs.org/The text was updated successfully, but these errors were encountered: