I installed the react-native-cli and did a react-native init testApp followed by react-native run-ios and all the world was good :)
Then I cd ~ && npm install react-native-ignite -g followed by ignite new testApp which had me left with this:
$ ignite new testApp
This command requires yo to be installed.
Installing yo...
(node:55281) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.
npm WARN deprecated [email protected]: this package has been reintegrated into npm and is now out of date with respect to npm
/Users/walther/.node/bin/yo-complete -> /Users/walther/.node/lib/node_modules/yo/lib/completion/index.js
/Users/walther/.node/bin/yo -> /Users/walther/.node/lib/node_modules/yo/lib/cli.js
> [email protected] postinstall /Users/walther/.node/lib/node_modules/yo
> yodoctor
Yeoman Doctor
Running sanity checks on your system
β Global configuration file is valid
β Node.js version
β No .bowerrc file in home directory
β No .yo-rc.json file in home directory
β npm version
β NODE_PATH matches the npm root
Everything looks all right!
/Users/walther/.node/lib
βββ [email protected]
π₯ Setting testApp on FIRE! π₯
-----------------------------------------------
( ) (
)\ ) ( ( /( )\ ) * )
(()/( )\ ) )\()) (()/( ` ) /( (
/(_)) (()/( ((_)\ /(_)) ( )(_)) )\
(_)) /(_))_ _((_) (_)) (_(_()) ((_)
|_ _| (_)) __| | \| | |_ _| |_ _| | __|
| | | (_ | | .` | | | | | | _|
|___| \___| |_|\_| |___| |_| |___|
-----------------------------------------------
An unfair headstart for your React Native apps.
https://infinite.red/ignite
-----------------------------------------------
Igniting testApp
π« Missing react-native - 'npm install -g react-native-cli'
$ npm list react-native-cli
/Users/walther
βββ [email protected]
$
Finally I tried to verify that the react-native-cli was actually there - which npm list react-native-cli seems to support ? So now I'am at a loss as to what next, debugging-wise?
Oh - and ignite doctor tells me this:
$ ignite doctor
/Users/walther/.node/lib/node_modules/react-native-ignite/node_modules/ramda/dist/ramda.js:4307
return str.trim();
^
TypeError: Cannot read property 'trim' of null
at Object.trim (/Users/walther/.node/lib/node_modules/react-native-ignite/node_modules/ramda/dist/ramda.js:4307:27)
at Object.f1 [as trim] (/Users/walther/.node/lib/node_modules/react-native-ignite/node_modules/ramda/dist/ramda.js:446:27)
at Command.<anonymous> (/Users/walther/.node/lib/node_modules/react-native-ignite/index.js:116:36)
at Command.listener (/Users/walther/.node/lib/node_modules/react-native-ignite/node_modules/commander/index.js:301:8)
at emitTwo (events.js:106:13)
at Command.emit (events.js:191:7)
at Command.parseArgs (/Users/walther/.node/lib/node_modules/react-native-ignite/node_modules/commander/index.js:615:12)
at Command.parse (/Users/walther/.node/lib/node_modules/react-native-ignite/node_modules/commander/index.js:458:21)
at Object.<anonymous> (/Users/walther/.node/lib/node_modules/react-native-ignite/index.js:133:21)
at Module._compile (module.js:541:32)
$
Wow, that seems like a lot going on. Obviously something isn't right.
OK, so since you typed npm install react-native-ignite -g I can assume you have the latest/greatest ignite, even though we can't see it in doctor.
The code that is failing for you seems to be right here: https://github.com/infinitered/ignite/blob/master/ignite-generator/src/app/index.es#L131-L147
What that code does, is run which to see if there's a result. So when you run which react-native do you get a result on your machine?
hmmm - strange!
when I do which react-native it returns nil (well it doesn't but that would be the effect if done programmatically, I guess)
but when I do $react-native - it returns
$ react-native
You did not pass any commands, did you mean to run `react-native init`?
$
well - the plot thickens!
$ npm list react-native
/Users/walther
βββ (empty)
npm ERR! code 1
$
then I did
$ sudo npm install -g react-native-cli
Password:
(node:59956) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.
/Users/walther/.node/bin/react-native -> /Users/walther/.node/lib/node_modules/react-native-cli/index.js
[email protected] /Users/walther/.node/lib/node_modules/react-native-cli
βββ [email protected]
βββ [email protected]
βββ [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected])
βββ [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected])
$
there seems to be something wrong with your setup :/
well - indeed
so I better remove npm, node et al?
Sorry to say I don't know what the fix will be, but yes, a blown away node and fresh proper install would be my next steps. You never know when this will bite you again, so it's key to fix it.
We could add something to ignite doctor that when it sees this, it would warn the user their setup is borked. Not sure how many of these we'll see. Perhaps it would be a good contribution, if you're not winded from a complete reconstruction of your local setup.
I reckon a fresh install would never hurt anyway - but then I guess Electron and a few other libs will send me on a few other detours. Come what may, I'm of to install-land :)
cheers,
(and thx for prompt replies)
This reminds me of npm 2 issues. When you have a dependency that can't find another dependency: thats npm 2. I recently had this issue on Reactotron. :(
But ya, I'm eith @GantMan on this one. Nuke and install latest node (6.5) from brew. :)
Good luck @wdiechmann ! See ya on the other side.
sorry to bother you (again) but this is not going away :(
what's the output of which react-native now?
(last line in the gist)
empty
and if it is any help at all
$ pwd
/Users/walther
$ cat .npmrc
prefix=/Users/walther/.node
$ ls .node/bin
ignite react-native yo yo-complete
$ .node/lib/node_modules/react-native-cli/index.js
You did not pass any commands, did you mean to run `react-native init`?
$
Are you able to create a React Native app without ignite?
I noticed you installed with sudo. I wouldn't recommend that. Half the issues we see are permission related. Ha!
I am - that was the first thing I did - line 78 in the gist :$
and I believe you're referring to my initial shot at it, @skellock ? In the gist all sudo-ing done by me is removing all my initially hard-earned node/modules these last 2-3 years :)
haha.
Strange. So from a shell, no path issues. From a script, problems. Hmm.
Where do you set your path for node? Do you have that in a bashrc or profile? Or are you running zsh? using something like dotenv?
well steve - that gist really is a wealth of information ;)
line 71-74 says:
$ echo $NODE_PATH
:/Users/walther/.node/lib/node_modules:/usr/local/lib/node_modules
$ cat .npmrc
prefix=/Users/walther/.node
- and the NODE_PATH gets set in ~/.bashrc on the last line like this
export NODE_PATH=:/Users/walther/.node/lib/node_modules:/usr/local/lib/node_modules
running a regular bash
as the react-native is something of a new (sidekick) to me - after killing all my node stuff, I hurried back to the "nuclear facility" and did a quick
$ git clone https://github.com/electron/electron-quick-start
$ npm install && npm start
Happy to report that all is well in 'Manhattan' :D
(so even if I'd really like to take a stab or two at this ignite thing - my electrons are safe and that's what will allow me to sleep well in a little while)
Guilty as charged. I didnt read the 1400 line Gist end to end.
Your PATH includes npm's global location. I'm at a loss as to why it wouldn't for scripts.
haha, good that the electron is stable. Now if we can figure out why which react-native is failing!
If you want to bypass this problem locally, you can go to your node modules and and comment that line out. That will allow you to move forward without the which command working.
@skellock - please allow me to apologise! I'd be quite a piece, using for free and adding insults on top! That was in no way my intentions! Weak command of a non-mother-tongue and eager to prove having covered my bases prior to crying 'wolf' - and on top of that I have this terrible habit of (mis)using irony and sarcasm -
@GantMan - I will add a // and be gone ;)
Actually - I woun't :)
What I did was ponder - and then I added $HOME/.node/bin to my PATH!
That helped ignite along - and everybody may now return to their stations and have a biscuit and a cup'o'tea :D
Sorry for all the commotion
I'm happy it's solved! I wasn't sure how our checks were failing.
Such an interesting dilemma! I wonder if we should add a check to the PATH variable if something comes back blank, or at least document this case? Glad all is well!
Indeed. For closure, I'd love to know how the shell knows, but a script doesn't. I wonder if perhaps the PATH was inside .bash_profile instead of .bashrc originally?
That _might_ explain it.
well - i would have been helped quite a bit if the ignite doctor had pointed out that my PATH was missing a βnodeβ element
if your commandExec(βwhichβ-something used the NODE_PATH to call react-native - of sorts
anyways - I didnβt quite see it coming - and am still puzzled by it -
cheers,
Walther
Den 6. sep. 2016 kl. 15.59 skrev Gant Laborde [email protected]:
I'm happy it's solved! I wasn't sure how our checks were failing.
Such an interesting dilemma! I wonder if we should add a check to the PATH variable if something comes back blank, or at least document this case? Glad all is well!
β
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub, or mute the thread.{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/infinitered/ignite","title":"infinitered/ignite","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/infinitered/ignite"}},"updates":{"snippets":[{"icon":"PERSON","message":"@GantMan in #354: I'm happy it's solved! I wasn't sure how our checks were failing.\r\n\r\nSuch an interesting dilemma! I wonder if we should add a check to the PATH variable if something comes back blank, or at least document this case? Glad all is well!"}],"action":{"name":"View Issue","url":"https://github.com/infinitered/ignite/issues/354#issuecomment-244958783"}}}
well - Steve
itβs as if youβre psychic :)
did a quick
$ more ~/.bash_profile
echo '.bash_profile start'
PATH="/usr/local/mysql/bin:$PATH"
PATH="/usr/local/share/npm/bin:~/.node/bin:$PATHβ
---snip---
and for good measure
$ more ~/.bashrc
export PS1='\$ '
shopt -s checkwinsize
PATH=$HOME/local/bin:$HOME/bin:$HOME/.node/bin:$PATH
I did the .bashrc βadd-onβ - but the .bash_profile was sitting there all the time! This is an important lesson (even with 20 years of *nix under my belt - most of which were decent scripting, bashing, etc - but it never crossed my mind to distinguish between the two SOGβs) ;)
cheers,
Walther
Den 6. sep. 2016 kl. 16.02 skrev Steve Kellock [email protected]:
Indeed. For closure, I'd love to know how the shell knows, but a script doesn't. I wonder if perhaps the PATH was inside .bash_profile instead of .bashrc originally?
That might explain it.
β
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub, or mute the thread.{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/infinitered/ignite","title":"infinitered/ignite","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/infinitered/ignite"}},"updates":{"snippets":[{"icon":"PERSON","message":"@skellock in #354: Indeed. For closure, I'd love to know how the shell knows, but a script doesn't. I wonder if perhaps the PATH was inside
.bash_profileinstead of.bashrcoriginally? \r\n\r\nThat _might_ explain it.\r\n"}],"action":{"name":"View Issue","url":"https://github.com/infinitered/ignite/issues/354#issuecomment-24495 9568"}}}