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

Long path support issues on windows when using npm3 #970

Closed
gertjvr opened this issue Oct 27, 2016 · 10 comments
Closed

Long path support issues on windows when using npm3 #970

gertjvr opened this issue Oct 27, 2016 · 10 comments

Comments

@gertjvr
Copy link

gertjvr commented Oct 27, 2016

Description

TL;DR when using npm3 node packages should not include their dependencies. ie shouldn't have a sub node_modules folder. on windows this can cause long path names. longer than what windows can support.
npm guidance https://docs.npmjs.com/how-npm-works/npm3

Long story but we use cake build scripts and it doesn't support long files paths on windows. We have had a similar issue recently when phantomjs broken release.

Environment

  1. npm ls react-scripts (if you haven’t ejected): [email protected]
  2. node -v: v4.4.5 / v6.9.1
  3. npm -v: v3.7.1 / v3.10.8

Then, specify:

  1. Operating system: Windows 10 and Windows Server 2012

node_modules structure after npm install

@gertjvr
Copy link
Author

gertjvr commented Oct 28, 2016

Guess I am the only windows user of cra 😄

@gaearon
Copy link
Contributor

gaearon commented Oct 28, 2016

I don’t think so. I haven’t had time to reply because I’m focusing on React itself this quarter and so this repo is less actively maintained.

It’s not clear to me why this happens. Do you have any idea? I thought npm3 is supposed to try flat structure when possible.

@gertjvr
Copy link
Author

gertjvr commented Oct 28, 2016

I have tried using yarn and it does exactly the same react-scripts ends up with multiple nested node_modules folders causing the long path name issues.

@thien-do
Copy link
Contributor

thien-do commented Oct 28, 2016

NPM do try flat structure if possible, so I think it is because of bundledDependencies.

Also, actually it is only nested 3 levels of node_modules, as the longest path (258 characters) is:

C:\TeamCity\buildAgent\work\82a0aa7e218f78a7\src\{APPLICATION_NAME[29]}
\node_modules\react-scripts
\node_modules\babel-preset-react-app
\node_modules\babel-plugin-syntax-trailing-function-commas\test\fixtures\trailing-function-commas\new-expression\expected.js

seems because babel-preset-react-app is bundled into react-scripts by purpose, so NPM don't try to flat them?

UPDATE:

One thing I noted that in my system, babel-plugin-sysntax-trailing-function-commas is at the same level with babel-preset-react-app. Not sure why in @gertjvr's case it is nested.. maybe that is the issue, not the bundledDependencies of react-scripts..

@gertjvr
Copy link
Author

gertjvr commented Oct 28, 2016

@dvkndn I am pretty new to node and how the packaging system works, how do you control the bundledDependencies as a package author? I referenced the phantomjs case but its not clear how they solved the issue. might have to do more reading.

@gertjvr
Copy link
Author

gertjvr commented Oct 28, 2016

@dvkndn @gaearon I see what you mean downgrading to v0.6.0 solved the issue for us and on closer inspection v0.6.0 didn't have any bundledDependencies.

@gaearon
Copy link
Contributor

gaearon commented Oct 28, 2016

We control bundledDependencies. We added them to cut the install time on npm 2. However now that Node 6 is the LTS release (and comes with npm 3) it may be a good time to drop support for npm 2 and remove bundledDependencies.

@thien-do
Copy link
Contributor

Yes remove bundledDependencies also help solve several bugs relating when forking CRA.

@gaearon gaearon added this to the 0.8.0 milestone Nov 20, 2016
@gaearon
Copy link
Contributor

gaearon commented Nov 20, 2016

Tagging this as 0.8.0 since that's the release where we should remove bundledDependencies and drop npm 2 support. cc @fson

@fson
Copy link
Contributor

fson commented Nov 22, 2016

Bundled dependencies were removed in #1068 so this should be fixed in the upcoming release.

@fson fson closed this as completed Nov 22, 2016
@lock lock bot locked and limited conversation to collaborators Jan 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants