Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Node.js distributions include npm with deeply nested node_modules #17409

Closed
rajsite opened this issue Dec 1, 2017 · 3 comments
Closed

Node.js distributions include npm with deeply nested node_modules #17409

rajsite opened this issue Dec 1, 2017 · 3 comments
Labels
build Issues and PRs related to build files or the CI. npm Issues and PRs related to the npm client dependency or the npm registry. windows Issues and PRs related to the Windows platform.

Comments

@rajsite
Copy link

rajsite commented Dec 1, 2017

  • Version:
    Any
  • Platform:
    Windows
  • Subsystem:
    npm

The zip distributions available on nodejs.org/dist include a copy of npm with deeply nested node_modules, for example: https://nodejs.org/dist/v8.9.1/node-v8.9.1-win-x64.zip

It would be helpful on Windows (with its terrible long path support) to run npm dedupe on the bundled npm prior to archiving. This will allow Windows archive tooling to extract the contents without error as well as other tools in the Windows pipeline.

Context:
Was including node.exe and npm in a .NET nuget package and the nuget tooling has sub par long path support and I think other projects have an issue with this as well.

When trying to bundle / unbundle the deeply nested resources into a nuget package everything seems to work okay. However if I tried to use the resulting bundled npm I would get errors occurring at module.js:538 saying that the semver library could not be found. This was because those modules somehow got lost in packaging / unpackaging process for the nupkg file.

Unzipping the distribution and using the global copy of npm on my dev machine to dedupe the bundled version before packaging seems to do the trick but is painful to automate since so many command line tools on Windows fail on the long paths.

@mscdex mscdex added build Issues and PRs related to build files or the CI. npm Issues and PRs related to the npm client dependency or the npm registry. windows Issues and PRs related to the Windows platform. labels Dec 1, 2017
@bnoordhuis
Copy link
Member

You should report this over at https://github.com/npm/npm/issues. We redistribute npm essentially unchanged from upstream and I don't think we want to be in the business of repackaging it.

@MylesBorins
Copy link
Contributor

closing in lieu of report at npm
AFAIK they do run dedupe as part of vendoring

@TheCloudlessSky
Copy link

@MylesBorins running dedupe doesn't really help fix the long path problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Issues and PRs related to build files or the CI. npm Issues and PRs related to the npm client dependency or the npm registry. windows Issues and PRs related to the Windows platform.
Projects
None yet
Development

No branches or pull requests

5 participants