Skip to content

Installing fail #13

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

Closed
zjoin opened this issue Oct 3, 2016 · 30 comments
Closed

Installing fail #13

zjoin opened this issue Oct 3, 2016 · 30 comments

Comments

@zjoin
Copy link

zjoin commented Oct 3, 2016

I installing create-react-app my-app --scripts-version custom-react-scripts, but it's fail

screen shot 2016-10-03 at 15 47 35

How to fix it?

@andrewhl
Copy link

andrewhl commented Oct 3, 2016

I just came here to post the same issue. +1

@andrewhl
Copy link

andrewhl commented Oct 3, 2016

Running:

`npm install --save-dev --save-exact custom-react-scripts` failed

inside the project folder gives me:

npm ERR! Darwin 15.5.0
npm ERR! argv "/Users/andrew/.nvm/versions/node/v6.6.0/bin/node" "/Users/andrew/.nvm/versions/node/v6.6.0/bin/npm" "install" "--save-dev" "--save-exact" "custom-react-scripts"
npm ERR! node v6.6.0
npm ERR! npm  v3.10.3

npm ERR! Path must be a string. Received undefined
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/andrew/code/ideas/npm-debug.log

@jbach
Copy link

jbach commented Oct 3, 2016

@kitze suggested downgrading to Node 6.2.0, which ought to fix the problem. I think it might also be a problem with npm 3.10.3 (introduced with node 6.3.0) rather than node itself, as using [email protected] on Node 6.7.0 works for me.

It also seems like this is only an issue with custom-react-scripts and not with the regular react-scripts? @kitze, maybe merging recent changes from facebookincubator/create-react-app to your fork would fix things?

Edit: It works with [email protected] on Node 6.7.0 as well (which was introduced with node 6.2.2), could it be [email protected] that’s causing troubles? It also works with [email protected] and breaks with [email protected]. So that confirms it’s an issue with npm rather than node.

@schabluk
Copy link

schabluk commented Oct 3, 2016

Same here. Node v6.7.0, npm 3.10.8.

@claylevering
Copy link

+1 to this and not really interested in downgrading my Node / NPM (or using alternatives with nvm).

@kitze
Copy link
Owner

kitze commented Oct 6, 2016

@jbach I just merged all the changes from the original create-react-app repo. I also merged few PRs and released version 0.0.15 on npm. I'm still getting the error. I'm investigating what can be the issue...

@andrewhl
Copy link

andrewhl commented Oct 7, 2016

Godspeed, my friend. I really want to use this library, but this failure is preventing me from even getting off the ground.

@spion
Copy link

spion commented Oct 8, 2016

Sounds like an issue with bundledDependencies being "fixed" (but not fully) in latest npm: https://github.com/npm/npm/blob/b38573fae383aaaeaec0548c2ae616778a3b5dab/CHANGELOG.md#erk

Specifically in this case it has problems when trying to normalize the path of babel-preset-es2015 which is a bundled dependency included by babel-preset-react-app. (I added some logging to find the module that causes the error)

My guess is, if you remove stage-0 (or some other module thats causing the conflict, though not sure which one!) from the bundled dependencies list, it will work. I'm assuming its stage-0 because the react-app preset already includes some of those, and that conflict causes the bundle to become "deeper" (in terms of nested node_modules), but I can't be certain.

edit: Actually tested, and removing stage-0 from bundled dependencies does seem to work.

@kitze
Copy link
Owner

kitze commented Oct 8, 2016

@spion thank you! I'll test it and push a fix asap.

@kitze
Copy link
Owner

kitze commented Oct 8, 2016

@spion the problem is that bundledDependencies get generated from the release.sh script:

# This modifies $clean_path/package.json to copy all dependencies to bundledDependencies
node ./node_modules/.bin/bundle-deps

@raygesualdo
Copy link

Just tried to give custom-react-scripts a shot today and ran into this install issue. Any quick fixes or hacks to get it working?

@claylevering
Copy link

@raygesualdo I'v gotten around it by temporarily using [email protected] - npm i -g [email protected]

@raygesualdo
Copy link

Thanks @claylevering. Installed with [email protected] then reverted back to current npm version.

@spion
Copy link

spion commented Oct 8, 2016

@kitze maybe something like this would work in publish.sh?

node -e 'j=require("./package.json");j.bundledDependencies.splice(j.bundledDependencies.indexOf("babel-preset-stage-0"), 1);fs.writeFileSync("package.json",JSON.stringify(j,null,2))'

@schovi
Copy link

schovi commented Oct 14, 2016

Same here
node 6.8.0
npm 3.10.8

Usage of older version of npm (3.9.5) seems fine.

@kitze
Copy link
Owner

kitze commented Nov 5, 2016

I removed the bundling of deps, because Facebook is also planning to remove them too.

Installing should work fine now. Tested with latest node and npm.

@kitze kitze closed this as completed Nov 5, 2016
@seanrasmussen
Copy link

I still get an error -- probably too soon to close this...

@claylevering
Copy link

@kitze - Not sure why, but npm i custom-react-scripts seems to still be trying to install an older version?

@seanrasmussen - Try this: npm i --save-dev [email protected] - this will install at @kitze's latest version and I just verified that it will install in the following environments:

node: v7.0.0
npm: v3.10.9

-C

@kitze kitze reopened this Nov 5, 2016
@kitze
Copy link
Owner

kitze commented Nov 5, 2016

@seanrasmussen can you tell me which combination of node/npm do you have?

@claylevering I have no idea why it would install a different version when on npm it clearly says "0.0.17 is the latest of 16 releases" :|

@seanrasmussen
Copy link

@kitze Node: 6.7.0 / npm: 3.10.8

@seanrasmussen
Copy link

BTW -- I just updated to node v7.0.0 and npm 3.10.9 and got the same error....

@kitze
Copy link
Owner

kitze commented Nov 21, 2016

Bundled dependencies are now removed. @seanrasmussen I just tested the app with both node/npm combinations that were failing for you. It worked fine: generating, running, building, ejecting.

Can you please try it again and let me know if it fails. Also @claylevering 🙏

@seanrasmussen
Copy link

@kitze -- not sure why but I'm still not getting a successful install happening (sorry! :-))

@kitze
Copy link
Owner

kitze commented Nov 22, 2016

@seanrasmussen can you provide a log or something? Are you sure you're running create-react-app new-app --scripts version custom-react-scripts ?

@seanrasmussen
Copy link

seanrasmussen commented Nov 22, 2016

@kitze Yup -- I just pasted the command from the instructions into the command line and ran it... It issues a throw error... I'm heading out for a meeting now, but I'll re-run and send more info on errors...

@seanrasmussen
Copy link

@kitze Here's a snap of my console after the error....
capture

@kitze
Copy link
Owner

kitze commented Nov 23, 2016

Ah okay so this is a completely different error that you're getting. Maybe it's some issue with Windows. Which version are you using?

Also, does the default create-react-app app command work?

@seanrasmussen
Copy link

@kitze I'm using Windows 7 (64 bit). I use create-react-app all the time without problems...

@kitze
Copy link
Owner

kitze commented Dec 12, 2016

@seanrasmussen I'm not sure if I should leave this issue open. Any updates with the latest version?

@seanrasmussen
Copy link

@kitze -- I just ran it again and get the same error. Other Win7 users may have the same prob, but if you want to close it go for it. I'll just continue 'ejecting' from the create-react-app to add decorators support..

@kitze kitze closed this as completed Mar 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants