Error: Cannot find module 'react/lib/invariant' - meteor

Not sure if any one of you have ever faced this issue. I have tried checking various sources online but nothing solved my issue.
I am following a tutorial on how to create a Meteor+ionic+react application from this link
https://medium.com/#SamCorcos/meteor-react-ionic-mobile-app-part-1-the-basic-template-9355ebf3397f#.qtl4fl5st
when i add the line
ReactRouter=require("react-router");
inside app.browserify.js and run the application, i get the following error.
Error: Cannot find module 'react/lib/invariant'
I am using following versions
react 0.14.3
cosmos:browserify 0.9.3
meteorhacks:npm 1.5.0
npm-container 1.2.0+
I am surely missing something thing here. Can anyone help.
Thanks,
Sri TejN

I found the solution myself. Just install the ReactRouter that is present in the meteor packages and do not include the line “ReactRouter = require(“react-router”);” in the file “ app.browserify.js”. But you can use the variable ReactRouter anywhere else in the code.

Just to confirm, in my case the solution also worked and added ReactRouter package:
meteor add reactrouter:react-router
Then commenting out line:
//ReactRouter = require("react-router");
In file lib/app.browserify.js and running Meteor again fixed the problem.
Thanks Sri Tej Narala.

Related

Circularity detected when running (vega:load-vega-examples)

When I load the vega-lite data sets using
(vega:load-vega-examples)
I get the following error:
Could not REQUIRE CL-DATE-TIME-PARSER: circularity detected. Please check your configuration
However, the examples appear to have loaded.
Also, before I installed cl-date-time-parser in quicklisp, I was getting an error message similar to:
Do not know how to REQUIRE CL-DATE-TIME-PARSER
Does anyone know how to get rid of these errors?
Many thanks!
The IMDB example requires cl-date-time-parser. I suspect that problem is that (require ...) only works when the library is in a location known to ASDF. In a new installation, this may not be the case. Now reported as issue #19.
Try loading the library with quicklisp and then rerunning load-vega-examples.

Error: Failed to lock directory "P:\Documents\R\win-library\3.6" for modifying try removing 'P:\Documents\R\win-library\3.6/00LOCK

I was trying to install the dplyr package on to my system but I am encountering the problem mentioned below:
install.packages("dplyr")
I got the error message
Error: Failed to lock directory "P:\Documents\R\win-library\3.6" for modifying try removing 'P:\Documents\R\win-library\3.6/00LOCK
I tried to follow the instruction by removing the 00LOCK file that was automatically created but that doesnt help as even after retrying to install the package after deleting the file I faced the same problem wherein the 00LOCK folder got automatically generated. Can some one please help me out in understanding why am I facing this issue and how to correct this error and download the packages.
I solved it with this pacman function that attempts to delete a 00LOCK(s) if it exists:
install.packages('pacman')
pacman::p_unlock()
It worked for me! Hope it works for you :)
I tried view(installed.packages()) to see where the packages are stored, post that I specified the path .libPath("path I saw in the installed.packages()") and then tried to rerun the installation and it worked.

How to troubleshoot Error: Could not find package root?

I am running the command: devtools::use_testthat()
and I get the error:
Error: Could not find package root.
Why this happens?
devtools appears now to require the user to setwd("~/path/to/package"), even if functions like devtools::release() have the pkg= parameter set correctly.
My problem was very similar, but running devtools::document(setwd(...)). The only thing that worked for me:
I copied the DESCRIPTION file from another package (https://github.com/filipezabala/voice);
I ran devtools::document(setwd(...)) again;
After that, I edited the DESCRIPTION file and ran again devtools::document(setwd(...)).

Neo4j spatial server plugin fails on withinDistance and closest java.lang.NoClassDefFoundError

I know that the plugin is being loaded properly, as other methods work such as spatial.procedures and spatial.addNode etc.
The error results after a call like this:
CALL spatial.withinDistance('profile_geo', [43.524, 96.7341], 500)
and the error that results is this:
Failed to invoke procedure `spatial.withinDistance`: Caused by: java.lang.NoClassDefFoundError: org/neo4j/cypher/internal/compiler/v3_0/commands/expressions/GeographicPoint
The same error appears when trying to use the closest function as well. Any help would be appreciated.
It looks that you are missing required Jar for GeographicalPoint class.
Please make sure you have this class in your Jars. I know this class exists in neo4j-cypher-compiler-3.0-3.0.3.jar but it is not going to work for you as it is residing in different namespace. If you will not be able to pinpoint the corresponding Jar in your environment please have a look at Maven repository and try to find it there.
short answer: upgrade to 3.0.3 (both neo4j and plugin)
long answer:
I ran into the exact same issue today. I was running version 3.0.2 with server plugin version 3.0.2 and ran the cypher query:
CALL spatial.withinDistance("spatial_records",{lon:20.0,lat:50.0},100000000)
Joran mentioned in the comments above that the REST API was a working alternative. So I tried that out and found he was indeed correct.
I tested this using httpie, with the following command:
cat tmp.json | http :7474/db/data/ext/SpatialPlugin/graphdb/findGeometriesWithinDistance
where tmp.json looks like:
{"layer" : "spatial_records","pointX" :3.9706,"pointY" : 46.7907,"distanceInKm" :10000000000}
While this works, using CYPHER with stored procedures would be nice. So upon further investigation, I noticed that a recent commit contained the following changes:
- <neo4j.version>3.0.1</neo4j.version>
+ <neo4j.version>3.0.3</neo4j.version>
...
-import org.neo4j.cypher.internal.compiler.v3_0.commands.expressions.GeographicPoint;
+import org.neo4j.cypher.internal.compiler.v3_0.GeographicPoint;
So I ended up downloading version 3.0.3 of both neo4j and the spatial plugin. Whatever the issue was before, seems to be fixed in this version. The call to the stored procedure now works as expected!

Issues in running R from Perl

I want to include Statistics::R for my program.
The statement I am including is:
use Statistics::R;
Is there something wrong with it?
I tried to run it with just this statement included, the error i got was
Can't locate Statistics/R.pm in #INC(#INC contains: /etc/perl /usr/local/lib/perl/5.14.2 /usr/local/share/perl/5.14.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.14 /usr/share/perl/5.14 /usr/local/lib/site_perl .) at rperl.pl line 2
By the way I am using perl(v5.14.2) on ubuntu,using remote access to a linux server.
The solution was to install the module as non-root user.
The details are provided in the following link:
http://users.soe.ucsc.edu/~you/notes/perl-module-install.html
After doing the things described here, a couple of small steps are to be completed which are mentioned in the following link:
http://perlmaven.com/how-to-change-inc-to-find-perl-modules-in-non-standard-locations
This worked for me! I hope it would be of help to others too!

Resources