NPM modules get required from /Users/node_modules/ instead of the project directory

There are various issues scattered around the repo related to this issue. Basically what happens is, for some packages, when you try to require some-module in a file, for example,
var someModule = require('some-module');

It tries to require the package from home directory instead of the project's node_modules directory, and the following wrror appears,
Unable to resolve module some-module from /Users/username/projectname/AwesomeProject/index.js: Invalid directory /Users/node_modules/some-module

Currently, the workarounds seem to be,

Delete the node_modules folder - rm -rf node_modules && npm install
Reset packager cache - rm -fr $TMPDIR/react-* or node_modules/react-native/packager/packager.sh --reset-cache
Clear watchman watches - watchman watch-del-all
Recreate the project from scratch

cc @amasad

cc @martinbigio @davidaurelio

That's really strange. Next time it happens can you list your watch roots? watchman watch-list

yes, we met the same problem.

Do we have a consistent repro case? I've experienced this too.

Same problem here on version 0.17.0.
$ watchman watch-list
{
    "version": "3.8.0",
    "roots": []
}

I also got this problem when asking for platform=ios

Do we have a way to recreate this? Any steps that might recreate.

I suspect that this is actually an npm bug.  It seems that npm is secretly deleting installed packages in my project's node_modules directory, when I install an unrelated package.  When it blows up with an error, it references /Users/node_modules/ because (I'm guessing) it's just searching up the directory tree 3-4 levels before giving up.
re-running npm install <module> —save for each of the missing modules fixes this issue for me.

npm 3 uses flat dependency structure. essentially node_modules are not resides in individual packages but only on the top level. Does it ring any bells? Is it references from the {somepackage}/node_modules/...?
Is this only seen in npm 3

I'm using npm 3.5.2.  I'm not sure if it applies to npm 2.  Are the latest releases of React Native even compatible with npm 2?  I remember having a hell of a time with npm 2 and needing to upgrade to 3, ~2 months ago.

I don't think we've tested npm 3. Although the node resolution algorithm (which we implement) should still work. Are all of you seeing this using npm 3?

@amasad No, I am using npm v2.14.7

:+1:  I'm seeing this too with npm 2.14.15 and node v5.1.0. I eventually got a fix by following @sgonyea's advice -- blew away the react-native npm module and reinstalled.
Interestingly none of:

watchman watch-del-all
rm -rf $TMPDIR/react-packager-*

fixed it for me. I experienced this after switching between two different React Native projects (one that relies on an older version). I ran the packager for both so maybe that will be part of the repro? It's not clear.
Either way I'm unblocked but this seems like a pretty nasty but. And googling for it yields a bunch of unrelated issues :P

@pcottle and whoever else is/has experienced this issue - putting up a repo (with node_modules checked-in) would be AWESOME to help debug this. I too have experienced it, and so have people on my team (on both npm 2 and npm 3). In our case, resetting cache and doing watchman watch-del-all has fixed it (though obviously that's not the ideal solution)...but I realllllly wanna see this fixed, and would be happy to dive in to do the fixing. So if anyone can repro and put up the test case on Github, that would be super helpful. Obv post node version along with it so that we can duplicate the env.

@skevy will do if I run into it again! My bad, I hadn't thought of checking in the repos -- usually i think of the package.json as being the source of truth (so all else doesnt matter).
Others seem to be reporting that restarting helps, so I'm worried its due to something in-memory (which means repro-ing is harder).
Anyways I'm getting a new laptop from FB in a few days which means a full reinstall of everything, so I'll post back if I run into it again

FWIW, this error message is just the symptom of the packager not being able to find some-module. It'll walk up the directory tree until it finds node_modules/some-module. It just so happens that /Users is the last directory to try, hence the weird /Users/node_modules directory in the error message.

npm cache clean && npm install fixed my project.
I encountered this bug after upgrading React Native from 0.14 to 0.17. After the upgrade I installed a new module and tried to require it in my code but the module could not be located. At this point I also tried to require a new JS file I had created. That did not work either.
I'm using nvm 0.29.0, Node.js 5.3.0, and npm 3.3.12.

Until we find the root cause for this it would be great showing a better error message with possible ways to fix the problem. For instance:

watchman watch-del-all
npm cache clean && npm install

Someone wants to send a PR for this? ;)

I keep getting this error every time I install a dependency from Github. There are some deps that do not support RN 0.16.0 and onwards and I have cloned them in order to ignore .babelrc. I cant make those work.

@alvaromb cd node_modules; find . -name .babelrc | grep -v packager | xargs rm # Removes all .babelrcs from node_modules is your friend

Thanks @frederickfogerty !

I have the same problem with 'react-native-maps', whatever I try the build fails.

Similarly to @btsai, restarting packager fixed the problem for me. Is adding modules while packager is running supported?
I think the module resolution is working properly, i.e. first node_modules from project directory is checked and then after unsuccessful match (probably due to packager not noticing the change), the resolver goes up the file system hierarchy, up to /Users/node_modules/<module> and fails with the last error message, which will be Unable to resolve module <module> from /Users/node_modules/<module>
I've looked at react-native/packager/react-packager/src/DependencyResolver/DependencyGraph/ResolutionRequest.js which I believe is the culprit here, but it would be good if someone more knowledgeable looked at it as well.

wow this was really annoying, spent hours on this one.
so far this has worked:
Delete the node_modules folder - rm -rf node_modules && npm install
Reset packager cache - rm -fr $TMPDIR/react-* or node_modules/react-native/packager/packager.sh --reset-cache

+1 platform=ios

@btsai's tip did it for me, was still encountering the issue after running both:
npm install --force
npm cache clean && npm install

But after closing the react-native/packager script terminal window and the simulator and building from scratch all was well.

It's kind of big issue, met it first time after upgrading to 0.18.1 and actually workarounds don't work for me. It happens with the native module we develop:
Unable to resolve module createReactNativeComponentClass from /Users/aylarov/Work/iOSReactApp/VoximplantDemo/node_modules/react-native-voximplant/VoxImplant.ios.js: Invalid directory /Users/node_modules/createReactNativeComponentClass

Same here. After upgrading to 0.18.1:
UnableToResolveError: Unable to resolve module module from /Users/MyUser/sxs-mob/MyAppName/node_modules/app-module-path/lib/index.js: Invalid directory /Users/node_modules/module

Seeing this too, on and off when adding react-native-facebook-login.  Error is:

uncaught error Error: UnableToResolveError: Unable to resolve module invariant from /Users/joewood/code/my-app/node_modules/react-native/Libraries/ReactIOS/NativeMethodsMixin.js: Invalid directory /Users/node_modules/invariant

<EMAIL_ADDRESS><EMAIL_ADDRESS><EMAIL_ADDRESS>
I see this is from the bundle script and/or the packager. Seems intermittent.

I tried to downgrade to 0.17 using
npm install --save<EMAIL_ADDRESS>but there is still no way I can get the project to work again. What else can be done to go back to a working copy ?

I had this a few times and unfortunately @29er's fix didn't seem to work for me. I am referring to this fix:
watchman watch-del-all
npm cache clean && npm install
What did seem to fix it (after killing the emulator and npm packager script) was deleting the node_modules folder and running the basic app init commands:

react-native init AwesomeProject
npm install

Running react-native init again won't destroy your project :) It will prompt you if you want to override the react-native generated files.

What did seem to fix it (after killing the emulator and npm packager script) was deleting the node_modules folder and running the basic app init commands:

react-native init AwesomeProject
npm install

Didn't work for me

Maybe also try running npm cache clean or @29er's complete suggestion after deleting the node_modules directory?
@aylarov I wonder if it's the way that you're exporting your node_module perhaps? I had some issues with a specific module but after various attempts with trial and error to originally fix this I can't be sure.

@thomasbandit I tried npm cache clean too, after I upgraded to 0.18.1 I couldn't get it working even after tried to downgrade back to 0.17 , although I do remember that it worked with 0.17 before. It's related to string var createReactNativeComponentClass = require('createReactNativeComponentClass'); in my module.

My issue was with my module, I fixed it, but there is definitely some issue if you copy/paste contents of the module w/o using npm install , I guess it is related to npm cache somehow.

Thank you @thomasbandit your solution fixed it:

react-native init AwesomeProject
(1a. copy my package.json to the folder)
(1b. say "no" to all override requests)
npm install

At least now I can continue development with no new modules.  Is there any way to override or expand the list of path where it is looking for the node_modules?

@Sexycrets I think that if you just add any new modules to your package.json before running that npm install you should be good.

I'm actually having this same problem with my Docker build jobs. This is just when executing react-native bundle, not when the packager is running in a terminal. Is anyone else seeing this problem?

@thomasbandit unfortunately not. I tried to run npm install and it did not work. I deleted the node_modules folder again and then run npm install and I still get the same error on any the package that I installed after upgrading to 0.18. Other ideas?

Not sure if this solves anyone else's problem, but I eventually solved this by forcing my Jenkins instance to run npm install and npm cache clean via sudo as a normal user account OSX using nvm, rather than as the Jenkins user, or inside a Linux Docker instance.

@MattFoley Thanks but did not work for me, I have a mac too.

I get this 'Invalid directory /User/node_modules/react' when trying to require 'react-router' in my react-native project. (I know there may be other reasons why react-router won't work with react-native, but I figured since #2985 was closed it was worth a shot).
Dev platform: OS X 10.11.2
Target platform: IOS 9.2
React Native version: 0.19.0
React-Router version: 2.0.0-rc5

Tried to update to 0.19 and have same issue with any module I try to install (app-module-path in this case).
React Native version: 0.19.0
Dev platform: OS X 10.11.2
App-module-path: 1.0.5

React Native 0.18.0 -> 0.18.1, 0.18.1 -> 0.19.0
OS X 10.10.5

Unable to resolve module react-native from /appdir/index.ios.js: Invalid directory /Users/node_modules/react-native

FWIW When I've run into this issue, and it's happened to me and a coworker a couple times, after clearing all the caches it sometimes helps to restart my computer. Also, when restarting my Mac and getting that Are you sure you want to restart dialog I needed to uncheck the Reopen windows when logging back in checkbox.
Sounds a bit extreme, but it's gotten me out of this issue a few times.

@jasonmerino thank you, could you please elaborate on the specific procedure you used to "clear all caches" before rebooting?
Thank you very much !

@Sexycrets clearing all caches was just referring to the steps in the very first post on this thread.

Delete the node_modules folder - rm -rf node_modules && npm install
Reset packager cache - rm -fr $TMPDIR/react-* or node_modules/react-native/packager/packager.sh --reset-cache
Clear watchman watches - watchman watch-del-all

@jasonmerino I did the following as you suggested:

```rm -rf node_modules && npm install````
rm -fr $TMPDIR/react-*
node_modules/react-native/packager/packager.sh --reset-cache (the terminal hanged after [9:28:43 PM] <END>   Building Dependency Graph (3365ms) so I killed it with control+C)
watchman watch-del-all (returned {  "version": "4.1.0",  "roots": [      "/Users/MyUser/myfolder/MyProjectName"  ] }
shut down my mac unchecking the box to reopen open windows then turned it on again
installed the package I want to use npm install --save app-module-path and it gets successfully installed<EMAIL_ADDRESS>/Users/FreeMako/sxs-mob/SexycretsMobile └──<EMAIL_ADDRESS>required in my main.js: require('app-module-path').addPath(__dirname);
opened the XCode project file under the iOS folder and clicked run
build succeeds (suspiciously quickly), the packager runs in the terminal
the simulator opens and I get the same error as before:

Is there any other reset or clean up that I can do?

I tried all of the above (clearing cache, restarting packager, rebooting, deleting node_modules, downgraded to NPM 2, ...) but I still get the same error.. Any one found another possible solution ?

I'm also having exactly this issue only with LinkedStateMixin. I've gone as far as reinstalling Node, restarting the project. At a bit of a loss here.

Same issue on
 import { Provider } from 'react-redux/native'

I tried everything on this thread and stuck :disappointed:
Are there any other workaround? Is someone working on it?
I've just upgraded from v0.15 to v0.19 to get all the new features which resulted in upgrading npm2 to npm3 and upgrading a lot of other dependencies. Fixed most issues but stuck on this one, help is appreciated.

@ranyefet you've removed node_modules and re-npm installed??

Joining in the fun. Tried all of this.
npm: 2.14.17 (downgraded from 3.x to work with react-native)
node: 5.5.0
react-native-cli: 0.1.10
react-native: 0.19.0
The sad thing for me is that the library that isn't being found is being introduced by another library (twilio) that i'm using.
This is what I see on the console in XCode:

"node_modules/twilio/lib/webhooks.js: Invalid directory /Users/node_modules/crypto"
And this in the emulator:

This is my package.json
"dependencies": {
"react-native": "^0.19.0",
"twilio": "^3.0.0-edge",
"url": "^0.11.0"
"crypto": "0.0.3",
}
The crypto module in question is found here - strangely in two places:
./node_modules/crypto
./node_modules/react-native/Libraries/vendor/crypto
This is a pretty solid blocker - hope to get some help.

This issue may be related: https://github.com/facebook/react-native/issues/5390
I would suggest redirecting the packager to use only the top-level version. I suggested using a rn-cli.config.js file to do this (see that comment thread). Create this file and place it in your project root. Substitute MYAPPNAME for your root dir name:
var blacklist= require("react-native/packager/blacklist");
var config = {
    getBlacklistRE(platform) {
        return blacklist(platform,[/MYAPPNAME.+\/node_modules\/crypto.*/]);
    }
}
module.exports = config;

This should ignore all crypto packages other than the one in your root node_modules.

I had the same issue trying to npm install different modules I found online. My issue was somewhat n00b but might help others.
If you are working in a React Native app, the npm module should be either built for React Native or in pure javascript.

@joewood doesn't your suggestion blacklist the top level? (rootDir/node_modules/crypto is being blacklisted here right?)

@ambarc no, the regex has a .+ - which is one or more chars. So that will exclude the top level from the blacklist and include indirect dependencies.

Completely missed the regex. Cool.

I have never upgraded from 0.17.0, that was the only stable release I've ever seen. This is solid road blocker and a dead end . Please resolve this..
Thanks

Upgrading Node from 4.2 to 5.5.0 fixed the issue for me, weird.

Update to 5.5.0 did not fix it for me. At least not for using this package: app-module-path

@ranyefet @Sexycrets using node 5.5.0 and facing the same issue.

go to YourProject/node_modules/react-native
run npm start from here

@filipgrkinic I tried and got the same error:

Log on the console:
[7:29:37 PM] <END>   Crawling File System (972ms) [7:29:37 PM] <START> Building in-memory fs for JavaScript [7:29:38 PM] <END>   Building in-memory fs for JavaScript (794ms) [7:29:38 PM] <START> Building in-memory fs for Assets [7:29:38 PM] <END>   Building in-memory fs for Assets (402ms) [7:29:38 PM] <START> Building Haste Map [7:29:39 PM] <START> Building (deprecated) Asset Map [7:29:39 PM] <END>   Building (deprecated) Asset Map (122ms) [7:29:39 PM] <END>   Building Haste Map (657ms) [7:29:39 PM] <END>   Building Dependency Graph (2833ms) [7:30:54 PM] <START> request:/index.ios.bundle?platform=ios&dev=true [7:30:54 PM] <START> find dependencies

@ambarc yeah... actually I'm not sure it's related but that the only thing that I changed :|

This problem was introduced with this commit: https://github.com/facebook/react-native/commit/793c3564ffb0c2b66abae0a5aa7997e2a9e4869c
I'm not sure this is the correct solution as it's breaking a lot of third party libraries. Also, it's only enabled for iOS :\
For now to fix 0.19.0 I've changed
react-native/packager/react-packager/src/Resolver/index.js:98

-shouldThrowOnUnresolvedErrors: (_, platform) => platform === 'ios',
+shouldThrowOnUnresolvedErrors: (_, platform) => {},

Maybe @martinbigio can give some more insight on a proper solution?

@kipricker Are you sure it's that commit and not this one? https://github.com/facebook/react-native/commit/6579b705e99c925ddaed10ddcdb7ba303ccb771f
The one you referenced was first introduced in v0.14.

The commit I linked to is the specific commit that introduced the idea of shouldThrowOnUnresolvedErrors. The later commit was just abstracting out the check.

this worked for me too

in terminal go to project/node_modules/react-native
run npm start from here
try now

I've tried above mentioned solution. Doesn't works for me.
Using node 5.6 and npm 2.14. Please suggest.

I tried the above suggestions, none of them worked so far.

None of the suggestions worked for me either. I recently upgraded my project from RN 0.17 to 0.19. I did not encounter this problem in 0.17.

Hi guys I managed to get the react-native-fbsdklogin working last night. It worked after I ran npm start in node_modules/react-native folder
I also upgraded my npm to 3.7.2 however I am not certain if that is related.

I still encountered the same problem on 0.20. Tried all of the suggestions above. None of them works.
RN: 0.20.0
Node: 5.1
NPM: 2.14

FYI, I was too able to get around this.
Start your project in XCode, wait until you get the error in the emulator. Close out of your console window and start react-native from node_modules via npm run start, and then refresh the emulator a few times.

wonderful got it working too. exactly like natdm described

You can also set it in your package.js:
    "start": "$NVM_BIN/react-native start"
  },```

I am upgrading our app from 0.14.0 to 0.20.0 (been too busy to upgrade), and we are having this issue as well.  None of the "workarounds" have worked...at all.  FWIW, I also tried upgrading to 0.21.0-rc and it still gives the same error).  Here is a screenshot of the error we get (the same as everyone else, just the PanResponder for us): http://cl.ly/2B3b3P0L2W00
I have seen some say that recreating the RN project may work, but will that really work?  Our app has a lot of 3rd party Libraries, Pods, Frameworks, Bundle Resources, Custom Build Phases, and Assets.  That is on top of making sure all of our Code Signing, Linking, Packaging, Search Paths, Info.plist, etc. are all setup correctly.  Doing all of this work without knowing if it will actually fix the issue is out of the question.
This issue has been open for 2 months, and I see little or no feedback that this is even being looked at.  It has the label of "Good First Task", which seems to imply this is a simple thing. However, if it is so simple, then why hasn't anyone proposed a practical solution or Pull Request?  I would happily hop in there and try to fix the issue, but I honestly have no idea where to even begin (I really have no idea why this is labelled as "Good First Task")
Having a huge, app-breaking, issues like this sitting open 2 months with people just saying "me too" does nothing but hurt the project's reputation, and piss people off.
Sorry if I sound impatient or "like a dick", but instead of finding an actual solution, the error message was updated to include instructions on how to work around the issue, which is obviously not working for everyone.
/rant

I created a new project in 0.20, reinstalled all third party libraries, and copied the source code over from 0.17 version of the project. It's working fine now.

I just created a new app running:  react-native init TestApp then opened the xcode project and running it in Xcode with no modifications and I still get the aforementioned error.

A little update.  I completely removed both node and npm and re-installed both using nvm.  I installed node 5.0 and npm 2, then I created another fresh RN project, and it ran fine.  However, my original app still gets the same error, so...idk what I am going to do.

I have literally tried every suggestion on here including an existing project and a new project and I still have this issue.
I am on macbook pro. V10.11.3.
Running:
Node: 4.3.1
NPM: 2.14.12
Any suggestion would be much appreciated.

@dhrrgn The only thing that has allowed me to continue working on a project affected by this is to just copy whatever node module that is complaining into the root of your project. The packager will be able to see it there and it should work. Maybe it only works for my specific use case though, I don't know.

@dhrrgn Did you try running the command react-native upgrade? I upgraded (albeit from a more recent version) and was very worried I would be fighting this issue for the rest of the day but had a nice surprise when it worked with no problems.

Ok, I have found how to reproduce this consistently:

react-native init BrokenApp
Run/build the app...all is well
Close the packager and the simulator.
Add react, to your package.json.

You will now get a lot of naming collisions due to fbjs being in both react-native and react.

To fix the errors, you have to also install fbjs in your package.json, then run the following commands to remove the nested versions:
find ./node_modules -name "react" -type d -prune -exec sh -c 'if [ {} != "./node_modules/react" ]; then rm -rf {};fi' \;
find ./node_modules -name "fbjs" -type d -prune -exec sh -c 'if [ {} != "./node_modules/fbjs" ]; then rm -rf {};fi' \;

Run/build the app... :boom:

You can add any packages you want, as long as they don't depend on react and all is well, but as soon as one depends on react, all hell breaks loose.
I am not sure if the bug is caused by simply installing react along-side react-native, or the fact that you have to remove react-native's copy and install it in the root that causes the issue.  All I know is that there are quite a few RN packages out there depend on react, and this is likely why some people are seeing the issue and others are not.

I tried everything from above answers. Nothing work upgrading my project from 0.16 to 0.20. Node is giving me following errors when I npm install.
I created new project from scratch. All good so far. I start to add my dependencies one by one. When I add npm install --save react-native-swipeout to my project I get following warnings from npm
$ npm install --save react-native-swipeout
npm WARN peerDependencies The peer dependency<EMAIL_ADDRESS>included from react-tween-state will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
npm WARN peerDependencies The peer dependency<EMAIL_ADDRESS>included from react-tween-state will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
<EMAIL_ADDRESS>node_modules/react-native-swipeout
├──<EMAIL_ADDRESS>
├──<EMAIL_ADDRESS><EMAIL_ADDRESS><EMAIL_ADDRESS>└──<EMAIL_ADDRESS><EMAIL_ADDRESS><EMAIL_ADDRESS>
and at this point I get the annoying screen which leads me to this page. Trying to remove now that package running npm uninstall react-native-swipeout removes package folder from node_modules and Reload JS error persists!! Restart my Xcode and rebuild project still same screen.
My feeling is this has nothing to do with react but with node itself. I was half way there. I update my npm to npm3

npm install -g npm3
rm -rf node_modules
npm3 install

All went well but I've got this:
`--<EMAIL_ADDRESS>  +-- UNMET PEER DEPENDENCY<EMAIL_ADDRESS>  +-- UNMET PEER DEPENDENCY<EMAIL_ADDRESS>  `--<EMAIL_ADDRESS>    +--<EMAIL_ADDRESS>    | `--<EMAIL_ADDRESS>    `--<EMAIL_ADDRESS>
It did not install dependency for react-native-swipeout (which I believe I can do manually as was described earlier in previous error messages).
Now building my App again... Message chaged Cannot read property 'Aspect' of undefined. ( For some reason RCTCamera was removed from my project).

npm3 install react
npm3 install react-dom

That fixed my issues.
To remove Name Collision this answer worked for me by @chirag04

Using npm3 does not fix the issue for me.  All peer dependencies are met.  Still at a loss here.

So, I got this working, but not exactly sure how...
I updated to Node 5.6 (was on 5.0.0), and NPM 3.6.  removed node_modules and re-installed.  I got the same error, except this time it was for a package I could easily remove (had to do with UUIDs)...for now.  Once I removed it, it worked!
Again, not sure exactly what in there fixed it, but...I still think there is an underlying problem here that needs fixed.  Will let you know if I find anything else.

Just go this working too, finally..
Updated Node and NPM. Did not add fbjs to package.json. Removed node_modules and used npm3 install to reinstall everything.

So I ran into this issue as well. Tried everything and nothing worked. The good thing is it was with one of my own modules and I finally tracked it down.
If the module doesn't build properly for RN (in my case I was using the path module from NodeJS) I'll get the same error as everyone else that the module can't be found. Even if it clearly exists in the node_modules directory.
So I'm not sure where to add it in the packager (or if it's even possible) but throwing an error that a file couldn't be built vs. not found would be awesome. One step further would be to even show the offending line.

I try everything and have same issue.
I add third party like "feed parser" and i have this issue

@meodemsao I think you have the same issue as me. sax.js tries to use the NodeJS stream module, which isn't available in React Native.

:+1:  do you have any solution to mix this package?

Hey guys,
I have had many issues like the ones posted here. What solved the issue for me was to install packages using the following command, making sure that you are doing so in the root directory of your project (where the index files and the node_modules folder are located):
npm install  --save.
The --save at the end is crucial since it edits your packages.json dependencies section. After installing modules with the --save at the end and making sure the packages.json dependencies were updated, I closed the terminal running the simulator, and ran the following command before rebuilding the project in Xcode:
npm cache clean && npm install
You might have to do this a few times with modules that you did not install with the --save option at the end. Also, you might encounter issues when you try to install a module via npm. I found that updating npm fixed all of those problems and you can find out how to do that here:
http://askubuntu.com/questions/562417/how-do-you-update-npm-to-the-latest-version
Hope this helps...

I finally got it for me too. I had to upgrade react-native-cli, then I created a new react native project, and then I ran npm install --save for each of my dependencies.
I then ran that project, killed the packager, then slowly add my code back.

I installed eway-rapid and am running into the same issue when I try to require it into my component. None of the solutions work and I get the following warning on installing eway-rapid:
<EMAIL_ADDRESS>requires a peer of continuation-local-storage@~3 but none was installed

Same problem here with package google-locations :
Unable to resolve module https from /Users/abelchalier/Desktop/cabelo/node_modules/google-locations/lib/google-locations.js:
Invalid directory /Users/node_modules/https

- OS X 10.11.3
- npm 3.6.0
- node 5.7.0
- react-native 0.19

I think it is a caching bug in npm3, no solutions working so far ...

Don't do npm install, do npm install [module-name] --save.
Try that.
Sent from my iPhone

On Mar 1, 2016, at 11:25 AM, esutton<EMAIL_ADDRESS>wrote:
I cannot install and use any additional npm packages as a module.
The module path is correct. I cut and paste the path displayed in xcode into a terminal to test path was valid and correct.
Using:
OS X 10.11.3
npm 3.3.12
node v5.5.0
react-native-cli: 0.1.10
react-native: 0.21.0
xcode 7.2.1
No work-arounds helped including:
npm3
rm -rf node_modules
npm start from ./node_modules/react-native.
watchman watch-del-all
rm -fr $TMPDIR/react-*
npm cache clean && npm install
Creating a new project from scratch
Modifying react-native/packager/react-packager/src/Resolver/index.js:98
-shouldThrowOnUnresolvedErrors: (, platform) => platform === 'ios',
+shouldThrowOnUnresolvedErrors: (, platform) => { return false; },
How does anyone get any work done in react-native without using additional npm packages?
—
Reply to this email directly or view it on GitHub.

Thanks Alex.  I first used  "npm cache clean && npm install"
When I first added a module I did use the "--save". For example:
npm install enum --save

Hmm... It is now working for me. I did the following:

Upgrade node/npm to latest
rm -rf node_modules
watchman watch-del-all
rm -fr $TMPDIR/react-*
npm cache clean
npm install [module] --save for each one again
Just started from xcode.

It seems like it is taking everyone repeated random tries to get it for them. Regardless, I'm wondering if the core team is looking into a solution for this, because it is obviously a pretty big problem.
Either the error is too cryptic to tell what the user really needs to do, or there is a bug and it is not looking at [project-directory]/node-modules/**.
I dug pretty deep into the source code but was able to get it working before I got to the actual place this error was being throw.

@alexprice91 I think it is really that the error is misleading and too cryptic. From what I've seen the cause is usually one of two things:

the module is missing (ie. npm install should fix it), or
the module or one of it's dependencies doesn't work with React Native. (ie. any Node module where a polyfill hasn't been added).

On occasion it seems like npm is just being flakey installing components or the packager is not picking up newly installed modules but just re-installing and/or restarting the packager usually clears that up.
@martinbigio any chance we can maybe lock this thread so that we stop getting messages of just crash logs? They don't really help and getting notifications each time is pretty distracting. :smile:

To follow up, @tovazm and @jcsjohnson I think you are both running into an issue where a dependency of a module you want to install is not compatible with React Native. (ie. the net, and https modules)

@satya164 what do you mean by "Recreate the project from scratch"?

Thanks @ekryski perhaps that is the right answer in my case since eway-rapid is the only module that has not worked. It is such a cryptic error message. I'll have to figure out some other way to get a payment gateway in my react native app.

@katrinanova Delete the project and start over again.

ekryski commented 18 hours ago
I think it is really that the error is misleading and too cryptic.
From what I've seen the cause is usually one of two things:
the module is missing (ie. npm install should fix it), or
the module or one of it's dependencies doesn't work with React Native. (ie. any Node module where a polyfill hasn't been added).

I think Eric Kryski's advice makes good sense. 1) Make a better error message.  2) Locking this thread sounds sensible.
I know my problem was trying to use npm packages that have probably never been used with react-native.  The error message is misleading since the package was installed.
I am a javascript and react-native newbie and have no idea how to determine if a npm package can be used with react-native or has a polyfill added ( or even know what a polyfill looks or smells like ).
The "enum" package was one I was trying to use.  I assume it is not usable with react-native for a reason not understood by this C++ guy learning react-native.
https://www.npmjs.com/package/enum
Thanks Eric!

There is one more reason why you could get this error and get sent to this issue:
You are trying to import a file with a .jsx extension (or other non-supported extension)!
I don't know why I gave my files a extension. I just realized now that it is not the 'official way'.
In<EMAIL_ADDRESS>the following worked:
Hi.jsx
console.log('hi')

index.ios.js
var hi = require('./Hi.jsx')

now in<EMAIL_ADDRESS>you get the same error telling you to reset cache, do npm install, visit this issue etc, even though the reason is a totally different one.
Is this intended behaviour or a bug?

the solution above solved my problem

hai iam using react-native version 0.21, When i try to install react-native-side-menu, I got like this in terminal  ENOENT: no such file or directory, open '/Users/stlmini-1221/package.json', in my simulator it shows like this

when  i checked in node-modules there is no react-native-side-menu module is there, can one tell me that what is the problem and how to resolve it

I had similar issue that it cannot find module crypto, which is required by "request" module.
In the code, originally I imported request module with
import request from request
Then I tried
var request = require('react-native').request and it works!
I got this idea from this post: https://github.com/joeferraro/react-native-env/issues/3
I'm not sure why though. Hope this helps!

I think @ekryski is on the money. Check if your deps run solely on node (which runs on the V8 engine as opposed to react-native in iOS which runs on Apple's JavaScriptCore).
An example with this is the 'crypto' package - I had it as a dependency and because it doesn't work with JavaScriptCore react-native wouldn't copy the package (present in the node build) to the build on the phone/emulator.
@martinbigio - A better message would include a warning that says that react native has seen incompatible packages that are both direct inclusions and transitive ones.

For those of you who encountered this error after upgrading to 0.21.0 or 0.22.0-rc, you will notice when you run react-native upgrade that react is now a peer dependency of react-native, therefore you must install react yourself. npm install react --save solved the "Unable to resolve module LinkedStateMixin" error for me.

Tried removing fbjs and react at deeper levels and installed them only at top level, but that din't fix the issue. On Upgrading to Node 5.0 and npm 3.3.6 worked for me.

set aside a night to work on react-native, and i spent almost two hours trying all these solutions and not getting anywhere last night.

what a mess!!!!

react-native 0.21.0 is ok, but 0.22.0-rc has this problem again.

Deleting the project seemed like overkill.
I was able to repro consistently and none of the cache clearing seemed to work, but this did:

from my project's root dir: rm -rf node_modules/firebase
npm install firebase --save
npm start
rebuild & compile from XCode

I had this issue. The problem was no projectRoots had node_modules in it.
I changed this:
{
  "scripts": {
    "start": "node node_modules/react-native/local-cli/cli.js start --projectRoots $PWD/Octoly/ReactComponent"
  }
}

To this:
{
  "scripts": {
    "start": "node node_modules/react-native/local-cli/cli.js start --projectRoots $PWD,$PWD/Octoly/ReactComponent"
  }
}

After many days of debugging, I've found that some imported modules were not "working", meaning they made the packager crash with the well known error. They were imported by one of my packages so the packager indicated that my module cannot be imported. The problem was that my project linked my package through nom and my package had a node_modules subfolder

Remember that getting this issue can have a variety of reasons, but if you have upgraded to 0.22.0-rc4 or similar, downgrading to 0.21 will most likely work for you:
npm install<EMAIL_ADDRESS>--save
watchman watch-del-all

Not sure if this will help anyone but I had this same issue and the problem turned out to be react-native AND react-native-cli both being installed globally. This being a result of upgrading the CLI. The fix was to remove the global install of react-native and therefore rely only upon the cli and local installs of react native.

I'm getting the Unable to resolve module LinkedStateMixin on > 0.21.0. I've tried every suggestion in this thread and nothing has helped so I've just resorted to downgrading for now.  It's not a peerDependency so you have to manually install it (if upgrading). I was having the LinkedStateMixin problem as well and that fixed it. (As well as clearing all caches and restarting the packager)

dear all,
i thinks react native packager not good,
i try use https://github.com/mjohnston/react-native-webpack-server to package lib
have ever any people use this solution?

Iäm gettung this error when I have following console.warn line
console.warn(`Failed to read state from '${k}' because ${error && error.message}`, error);

React Packager interprets this as a require statement for some reason?

update npm to 3
npm install react --save-dev

This solve my problem.

I've been going in circles with this issue for a while -- it seems the problem is the npm packages I'm using are relying on the builtin node libraries (eg. crypto) and that these node libraries aren't available on the device.
Are there any plans to pull in the node builtins?

@hugooconnor I do not think it would make sense to do so. Those libraries are built specifically for the node environment. You would have to build a polyfill for each one; I'm not sure if that is possible on iOS's JavaScriptCore or Android's V8.

I had this issue too, but I fixed it by specifying (in package.json) version ^0.14.5 for react.

I get the same problem under ios platform. None of the workarounds here solved it.

Is there some work arounds that work for this? I even created a new project and it still creates this error :(

@gelobelo02 hey Angelo, have you tried to cleanup your node installation, maybe try to use fresh copy of NVM instead.

Will try that

any progress here?
I have to remove node_modules and npm install everytime I upgraded react-native
It is quite annoying!

@eugenehp  tried did not work either :(

I think although it is a bad error message, the problem has always been in the local person's setup. The most common problems appears to be:

Using a module that has code not supported on iOS or Anroid
Not having the module installed
Not installing the module with --save

I would suggest a PR with a better error message and then closing this.

On Apr 18, 2016, at 10:18 PM, Horcrux<EMAIL_ADDRESS>wrote:
any progress here?
I have to remove node_modules and npm install everytime I upgraded react-native
It is quite annoying!
—
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub

@alexprice91 not so sure about the environment problem.
Same setup works for me in android, but in iOS I have this problem.

Following the error messages and then re-starting the packager did it for me.

One thing I noticed was having an unmet peer dependency, particularly on the React module, was causing an issue:
UNMET PEER DEPENDENCY<EMAIL_ADDRESS>
To solve this I just gave it what it wanted and set the exact React version in my package. Then I:

removed my node_modules directory
did a fresh npm install
ensured there were no warnings
then did a npm start -- --reset-cache

That seemed to have done the trick, but probably just one of the many permutations of this issue.

Happens to me as well on react-native-android-statusbar on iOS.

I had this problem whilst integrating React Native into my current iOS app; downgrading to 0.14.8 fixed it.

Same problem with an iOS app. I tried everything from above.

Happens to me to. Restarting is a pain, but it seems to clear the cache.

Any other suggestion? My code still breaks ><

I’ve run into this issue with React Native 0.24 when attempting to install the apsl-react-native-button module. Here’s a few of the things I’ve tried to resolve this:

followed steps 1-3 as directed by the “red screen” in the iOS simulator/Xcode console
downgraded to previous versions of React Native including 0.21 which was recommended in at least a couple comments above
fresh clone of my app’s project code which included a fresh ‘npm i’

None of these workaround attempts have been successful.
I can confirm that apsl-react-native-button was installed at the root of the node_modules dir for my project.
Given the volume of comments and participants on this ticket and that others are still encountering this in recent weeks could we please get an update from someone on the dev team ( @martinbigio ) ? If a fix or more reliable workaround is imminent this would be great to know, otherwise I need to plan my own workaround (which could be to develop without any 3rd party modules).
Thanks.

Everyone so far who has solved the issue on their project, it has been an issue with either how module are installed, or which modules are installed.
If you want community help I would suggest:
1. Listing your package.json
2. Rebuild your project by commenting out all other files outside of your root file. Once you have done this, slowly uncomment until you find the culprit. If you comment out everything besides a very basic intro file and still have this bug, then there is something wrong with your local build of React-Native. If the basic intro file works, then the issue is one of your modules.

Basic intro file:
import React, {
  Component,
} from 'react';
import {
  AppRegistry,
  Text,
  View,
} from 'react-native';

function App() {
 return <View><Text>This Works</Text></View>;
}

AppRegistry.registerComponent('app-name', () => App);

If it is one of the modules.. how to fix it? I've tried every single example here and nothing. I've been on this for 7 days now.

here is my code with this issue :
https://github.com/rikilamadrid/authentication_app

You just have a couple of errors in your code. Here is a pull request to mitigate these issues:
https://github.com/rikilamadrid/authentication_app/pull/1

I'm running into this now, as well.  I have a pretty barebones React Native project going, running on iOS, and breaking on the 3rd party library watson-developer-cloud, version 1.4.1.  All I've got right now.

The error I made that caused this for me (and some other issues) was to run npm outdated which told me to upgrade react from 0.14.8  to 15.0.2.  Do not do this.  After reverting the change and following all the npm clean up instructions I got back to a working system.

It happens when I use some.jsx as module name, when I change to some.js,it work.I don't
know why...

@facebook-github-bot answered

Not sure if anyone's found a good fix for this yet, but what seemed to work for me was setting environmental variable NODE_PATH=./node_modules

I got this after upgrade from 0.25 to 0.26

me too, 0.26-rc went fine, though. (except HMR of functional components didn't work, see https://github.com/facebook/react-native/issues/7539)

I spent several hours trying to get this resolved and trying all of the recommendations in this thread but to no avail. Finally I realized I had accidentally installed a module in a parent directory outside my project. Once I ran a `rm -rf node_modules

I just ran into it as well, make sure that you have react 15.0.2 installed. If you have "react": "^15.0.2" in your package.json it will install React 15.1.0 which is not supported by RN 0.26.1. So use "react": "15.0.2"

Thanks @knowbody, that fixed the issue but now I get something even more frustrating

My package.json looks like
  "dependencies": {
    "react": "15.0.2",
    "react-native": "0.26.1",

@jaimeagudo I just edited my previous comment

I doubt your App.js is exporting the right thing. We really need to end this thread since it has become a catch all for irrelevant things.
Sent from my iPhone

On May 23, 2016, at 10:12 AM, Jaime Agudo<EMAIL_ADDRESS>wrote:
Thanks @knowbody, that fixed the issue but now I get something even more frustrating
My package.json looks like
"dependencies": {
"react": "15.0.2",
"react-native": "0.26.1",
—
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub

Thanks again @knowbody, github expired cache made me wait a lot till your edition was reachable, it definitely was the cause on the 1st case.
My original code was https://github.com/bartonhammond/snowflake so as exercise I decided to fork & bump versions to get familiar with the env trying to troubleshoot further and contribute back. This is the result https://github.com/jaimeagudo/snowflake but unfortunately I face the same issue once I fixed the packages versions & imports.
Thank you all guys 👍

when i update react-native to 0.27.0-rc, this happens again.
this is really frustrated,  like be haunted by a ghost... 😞

I tried using react-15.1.0 but no luck, still getting Unable to find this module in its module map or any of the node_modules directories under /Users/node_modules/ReactDefaultPerf and its parent directories.
No idea what to do - followed the instructions
watchman watch-del-all
rm -rf node_modules && npm install
npm start -- --reset-cache

Help!

@npomfret make sure:

react 15.1.0 match react-native 0.27.0-rc
react 15.0.2 match react-native 0.26.x

Same problem with 15.0.2 (with rn 0.26.x).  And I also get this error from npom:

I solved it by removing all ~ and ^ symbols from my package.json so all dependencies have explicit versions.  And then ran:
npm cache clean && watchman watch-del-all && rm -rf node_modules && npm install && npm start -- --reset-cache

I'm using 0.21.0 but now when I add new dependencies. The same error reappear... 😣

I upgrade npm to latest version (3.9.3) and everything work like a charm !!!

sudo npm install npm -g
watchman watch-del-all
npm cache clean && npm install
DONE...

## I'm facing this issue, anyone could help me to resolve it ?
2016-06-01 12:35:53.080 [fatal][tid:main] Unable to resolve module fbjs/lib/warning from /Users/andy/Desktop/Projects/react-native_Project/faceBookopen/Libraries/react-native/react-native.js: Unable to find this module in its module map or any of the node_modules directories under /Users/node_modules/fbjs/lib/warning and its parent directories

After I had tried too many times with rm -rf node_modules && npm install, npm start -- --reset-cache(etc) and without any error，

my ios emulator also prompt the above info, I can find the warning.js under /Users/node_modules/fbjs/lib/

@ajnudnyy - if you have upgraded to React Native 0.26 then you might need to install "react" 15.0.2 which is a dependency.  For me, after installing "react" it started to work for me.

Yes, as @ajnudnyy said, make sure your package.json file contains:
"dependencies": {
  "react": "15.0.2",
  "react-native": "0.26.2",

The thing that solved it for me was using explicit versions (remove any ^ or ~ symbols from the file).
And then run:
npm cache clean && watchman watch-del-all && rm -rf node_modules && npm install && npm start -- --reset-cache

abrahamdurairaj:
Ok, as you said, it's extremely useful for me.
Would you mind that show me  where I could configure node server URL.
As the following picture shown,  I got this problem when I run example on our project.

Its in AppDelegate.m, mine looks like this:
#ifdef DEBUG
  jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/index.ios.bundle?platform=ios&dev=true"];
#else
  jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
#endif

                                                                                I have same issue, what I do to fix this.Delete node_modules, clear cache. In package.json remove "react", keep "react-native" then npm install.                                                                                From: ajnudnyySent: 5:22 CH Thứ năm, ngày 2 tháng sáu năm 2016To: facebook/react-nativeReply To: facebook/react-nativeCc: MikeNguyen; CommentSubject: Re: [facebook/react-native] NPM modules get required from /Users/node_modules/ instead of the project directory (#4968)abrahamdurairaj:
Ok, as you said, it's extremely useful for me.

Would you mind that show me  where I could configure node server URL.
As the following picture shown,  I got this problem when I run example on our project.
—You are receiving this because you commented.Reply to this email directly, view it on GitHub, or mute the thread.

Anyone who's upgraded to 0.27*, make sure you have react 15.1.0 installed.

@grabbou can this be mentioned in the release docs? I know it's specified in peerDependency but still easy to miss.

The error message is misleading. Just make sure you import react and react-native separately and properly first.

In the process of trying to get to the up-to-date version of react-native from 0.14.2. Successfully installed version 0.15.0. Trying to install 0.18.0 at the moment but i am bumping into a similar issue.
Error building DependencyGraph:  Error: Naming collision detected: /Users/path_to_project/node_modules/fbemitter/node_modules/fbjs/package.json collides with /Users/path_to_project/node_modules/react-native/node_modules/fbjs/package.json
My Package.json:
{   "name": "snofolio",   "dependencies": {     "events": "^1.1.0",     "flux": "^2.1.0",     "jquery": "^2.1.4",     "moment": "^2.10.6",     "react-dom": "~0.14.0",     "react-native": "^0.19.0",     "react-native-blur": "^0.7.10",     "react-native-calendar": "0.6.2",     "react-native-camera": "^0.3.8",     "react-native-carousel": "^0.4.4",     "react-native-communications": "^0.2.3",     "react-native-fs": "^1.3.0",     "react-native-google-analytics-bridge": "^0.4.0",     "react-native-image-picker": "^0.14.3",     "react-native-image-progress": "^0.4.0",     "react-native-qrcode": "^0.1.3",     "react-native-radio-buttons": "^0.6.0",     "react-native-swipeout": "^2.0.12",     "react-native-uploader": "0.0.9",     "react-native-video": "^0.7.1",     "underscore": "^1.8.3",     "whatwg-fetch": "^0.10.1"   },   "devDependencies": {     "browserify": "^6.2.0",     "watchify": "^2.1.1",     "babelify": "^6.0.0"   },   "scripts": {     "start": "watchify -t babelify js/main.js -o webbundle.js"   } }
nb: I do have under node_modules a react folder.
I tried the following commands without success:

Delete the node_modules folder - rm -rf node_modules && npm install
Reset packager cache - rm -fr $TMPDIR/react-* or node_modules/react-native/packager/packager.sh --reset-cache
Clear watchman watches - watchman watch-del-all

I unfortunately have no clue at the moment, any idea or hint is welcome.

This is an old issue with fbjs being duplicated in the tree. See this issue https://github.com/facebook/react-native/issues/5467. There are workarounds on that ticket, but I think the duplicate package issue has been resolved, so you're better off upgrading all the way to 0.27.

@joewood thanks for your prompt reply :)

This error message is clearly misleading. The problem in my case came from a missing module. It should be made more obvious.

Just ran into this. Rebuilding in Xcode fixed it, although you might have to apply some of the other fixes before also (nuking node_modules, resetting cache etc).

Hi all, been running into this bug for a day or so now. This is a pretty major blocker for me. I'm working from a starter repo, with examples that run perfectly until I start adding in new dependencies. I've tried every afore-mentioned suggestion to fix this but still get the same error. If anyone has another suggestion I'm open to any ideas.

Also constantly getting these errors - latest NPM, Node, fresh npm i, watchman clear etc.

Also npm link doesn't seem to work with watchman due to it not working with symlinks? Which is pretty important for local component development. And if I remove watchman (and I guess it falls back to the Node one?) then it fails if my linked component has react or react-native packages in it.
Failed to build DependencyGraph: @providesModule naming collision:
  Duplicate module name: BeforeInputEventPlugin
  Paths: /Users/tobidom/Sites/nice/native-catalogue/node_modules/dbk-native-fx-tile/node_modules/react/lib/BeforeInputEventPlugin.js collides with /Users/tobidom/Sites/nice/native-catalogue/node_modules/react/lib/BeforeInputEventPlugin.js

This error is caused by a @providesModule declaration with the same name accross two different files.
Error: @providesModule naming collision:
  Duplicate module name: BeforeInputEventPlugin
  Paths: /Users/tobidom/Sites/nice/native-catalogue/node_modules/dbk-native-fx-tile/node_modules/react/lib/BeforeInputEventPlugin.js collides with /Users/tobidom/Sites/nice/native-catalogue/node_modules/react/lib/BeforeInputEventPlugin.js

This error is caused by a @providesModule declaration with the same name accross two different files.
    at HasteMap._updateHasteMap (/Users/tobidom/Sites/nice/native-catalogue/node_modules/node-haste/lib/DependencyGraph/HasteMap.js:162:15)
    at /Users/tobidom/Sites/nice/native-catalogue/node_modules/node-haste/lib/DependencyGraph/HasteMap.js:127:25

@DominicTobias Here is an alternate to symlinks that can help with component development: https://github.com/wix/wml

I have this issue trying to include a "node" node module. I think the problem is how node and the react native packager treat require(). For example the standard modules of node are not included. I included all of them and suddenly this error occurs. I am not very familiar with react native nor node but I guess this could be fixed by adding a compatibility layer to the react native packager. Correct me if I'm missing something.

Error:
"Unable to resolve module react from /Users/andrewy/sourcecode/github/.../...ios.js: Unable to find this module in its module map or any of the node_modules directories under /Users/node_modules/react and its parent directories
"
How it happens
My project works few hours ago, all changed after i tried install a package "react-native-web-container", after i start project again, it goes wrong.
I don't know why it is searching "/Users/node_modules/react".
All those suggestions above don't work.
Env:
My project is a mixed project, migrated from a native project, all those js files are integrated into existing native project.
npm, 3.9.5
react-native-cli: 1.0.0
react-native: 0.26.3
Help needed
I want to know how to make the npm search the correct folder. All suggestions above does not work for me.

I am just starting with RN, in my case watchman doesn't seem to be running at all - i am always getting:
Please specify a target and action

Having the same problem here (can't resolve my own modules), though strangely just yesterday it's working OK, and I haven't changed anything.
Hmm, need to investigate ;D

I'm posting my fix again since I get this a lot and always get it fixed.
I get it when (and this isn't the only use case) I rename a folder or file that's already been used. Fixing the import paths don't fix the issue.
I just have to cd to AppPath/node_modules/react-native and run npm start from there.
After that, I don't have to do it again until I get the error after something funky happens.

I have the same problem when I use the reddit node module:
https://github.com/reddit/node-api-client
I tried different react/react-native version mentioned above and reinstall the modules but still doesn't work.
I am using npm 3.
my dependencies in package.json:
{     "fbjs": "^0.6.1",     "react": "15.0.2",   "react-native": "0.26.2",     "react-native-navigation": "latest",     "react-native-search-bar": "^2.11.0",     "react-native-vector-icons": "^2.0.3",     "react-redux": "^4.0.6",     "redux": "^3.0.5",     "redux-thunk": "^1.0.3",     "seamless-immutable": "^5.0.1",     "shitty-qs": "^1.0.1",     "snoode": "^1.23.1"   }

Hi guys,
After upgrading npm/node/react-native/react to its latest:
react-native: ^0.29.0
react: 15.2.1
npm: 3.10.3
node: 6.3.0

Then:
watchman watch-del-all
npm start -- --reset-cache

This issue went gone : )
Hope this helps.

I've tried every listed solution here. None worked for me.
react-native: ^0.29.0
react: 15.2.1
npm: 3.10.3
node: 6.3.0
OS X 10.11.5
I'm going to have to abandon a couple of weeks work and use something else, can't get React Native to work for me.

@dangrsmind I was in your shoes a couple weeks ago, and used the "nuclear option" to recover:
Rename your existing project folder MyProject > MyProjectOld
Delete node & npm:
http://stackoverflow.com/questions/11177954/how-do-i-completely-uninstall-node-js-and-reinstall-from-beginning-mac-os-x
Now start over with fresh install of React-Native (per https://facebook.github.io/react-native/docs/getting-started.html):
Install Node:

brew install node

Install React-Native:

npm install -g react-native-cli

Create new project (in your project folder):

react-native init MyProject

Run the new project:

cd MyProject
react-native run-ios or react-native run-android
You should have the basic Welcome to React Native! app running

Replace contents of MyProject with MyProjectOld (file-by-file)

npm install --save <any packages you need for MyProject>

It's an ugly solution, but hopefully helps you get back up and running!

@marcpechaitis I have used this "nuclear option" for other problems (i messed sth up while trying to solve the problem in this thread). The project is running again but I cant still use the module I want.
Now i give up and try to use other module instead.
@dangrsmind I tried the same version of react as you before and cant made it work. I recommond you to downgrade the react version and try to use other module.

Hey try this
watchman watch-del
Example
watchman watch-del /Users/username/WorkSpace/projectName
watchman watch-project <path-to-your-project
Example
watchman watch-project /Users/username/WorkSpace/projectName

Am I the only one having this issue, but the missing file is inside my own src folder? For some reason I cannot require my own files. React (Native) works fine however.

It happens when I use some.jsx as module name, when I change to some.js,it work.I don't
know why...

why does this work? -_-

This is unrelated to .jsx/.js for me. Bizarrely if I npm install one of my private modules it breaks with this error. The modules is very simple and just defines some constants like colors.
What breaks is that the module requires chromath to do a color lighten .. for some reason that breaks react-native... even though chromath is a pure JS file with no dependencies except a require to a local utils file... also with no dependencies :/

Hi, I got this error when installing a module named lokka.
Error:
Unable to resolve module url from /Users/jointsong/Documents/trunk_applysquare/ApplySquare/React/node_modules/node-fetch/index.js: Unable to find this module in its module map or any of the node_modules directories under /Users/node_modules/url and its parent directories
ReactNative 0.29
Node 4.2.0
npm 3.9.5

Im have same problem and try every thing in this case...but it's not working....
i try this :
watchman watch-del-all
rm -rf node_modules && npm install
npm start -- --reset-cache

but throw error again...

Even this react rnplay example I randomly browsed to has the same issue trying to use cssVar 😂
https://rnplay.org/apps/Sv6e5Q

@DominicTobias :||| how solve this problem?
Im very searched but cant find any answer...

Maybe this can help, my error was related to react native promise package.
react-native have promise as dependency and promise have asap that is including node build in module domain
I have just replaced asap node version with browser version and was able to build project again.
related issue https://github.com/kriskowal/asap/issues/64

I was facing the same problem and was solved after doing these steps.
watchman watch-del-all
npm start -- --reset-cache
rnpm link
Node version 4.2.4 npm 3.7.1

None of the above steps worked for me until I converted my code over ES6.
  "dependencies": {
    "react": "15.2.1",
    "react-native": "0.30.0"
  }

Consider the following...
From inside index.ios.js and index.android.js:
import React, { AppRegistry } from 'react-native';
import App from './src/main';

AppRegistry.registerComponent('App', () => App);

Then my main.js:
import React, { Component } from 'react';
 import {
   StyleSheet,
   Text,
   View
 } from 'react-native';

 import Signin from './components/authentication/signin';
 import Signup from './components/authentication/signup';
 import Tweets from './components/tweets/tweets';

 const ROUTES = {
   signin: Signin,
   signup: Signup,
   tweets: Tweets
 };

 const styles = StyleSheet.create({
   container: {
     flex: 1
   }
 });

 class App extends Component {
   renderScene(route, navigator) {
     const Component = ROUTES[route.name]; // ROUTES['signin'] => Signin
     return <Component route={route} navigator={navigator} />;
   }

   render() {
     return (
       <Navigator
         style={styles.container}
         initialRoute={{name: 'signin'}}
         renderScene={this.renderScene}
         configureScene={() => { return Navigator.SceneConfigs.HorizontalSwipeJump; }}
         navigationBar={
          <Navigator.NavigationBar
            routeMapper={{
              LeftButton: (route, navigator, index, navState) =>
               { return (<Text>Cancel</Text>); },
              RightButton: (route, navigator, index, navState) =>
                { return (<Text>Done</Text>); },
              Title: (route, navigator, index, navState) =>
                { return (<Text>Awesome Nav Bar</Text>); },
            }}
            style={{backgroundColor: 'gray'}}
          />
         }
       />
     );
   }
 };

 export default mobile;

The same goes for the other components. Make sure you are using imports instead of requires and
class App extends Component
instead of
module.exports = React.createClass({
Hope this helps!

For reference, this is what the main.js looked like before I converted it to ES6:
var React = require('react-native');
var {
  StyleSheet,
  Navigator,
  Text
} = React;

var Signin = require('./components/authentication/signin');
var Signup = require('./components/authentication/signup');
var Tweets = require('./components/tweets/tweets');

var ROUTES = {
  signin: Signin,
  signup: Signup,
  tweets: Tweets
};

module.exports = React.createClass({
  renderScene: function(route, navigator) {
    var Component = ROUTES[route.name]; // ROUTES['signin'] => Signin
    return <Component route={route} navigator={navigator} />;
  },
  render: function() {
    return (
      <Navigator
        style={styles.container}
        initialRoute={{name: 'signin'}}
        renderScene={this.renderScene}
        configureScene={() => { return Navigator.SceneConfigs.HorizontalSwipeJump; }}
        navigationBar={
         <Navigator.NavigationBar
           routeMapper={{
             LeftButton: (route, navigator, index, navState) =>
              { return (<Text>Cancel</Text>); },
             RightButton: (route, navigator, index, navState) =>
               { return (<Text>Done</Text>); },
             Title: (route, navigator, index, navState) =>
               { return (<Text>Awesome Nav Bar</Text>); },
           }}
           style={{backgroundColor: 'gray'}}
         />
        }
      />
    );
  }
});

var styles = StyleSheet.create({
  container: {
    flex: 1
  }
});

This error is proboly caused by that your current branch is master,  the code you cloned from github is lastest.
the master code is from so many numbers.
I sugest switching branch with command like git checkout 0.2.3.
在2016年07月29 18时07分<EMAIL_ADDRESS>@DominicTobias :||| how solve this problem?
Im very searched but cant find any answer...
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.

This error is proboly caused by that your current branch is master,  the code you cloned from github is lastest.
the master code is from so many numbers.
I sugest switching branch with command like git checkout 0.2.3.
在2016年07月29 17时39分, "Dominic<EMAIL_ADDRESS>Even this react rnplay example I randomly browsed to has the same issue trying to use cssVar😂
https://rnplay.org/apps/Sv6e5Q
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.

Same here. I'm blocked on the most trivial thing, adding a new module to my project. Not happy.

Update on my issue. I think I understand the problem now. It seems the node module I'm including would like to use the buffer module. This npm module works fine in React web application. However it seems it needs Nodejs buffer module which I had to include manually. After doing so, I am now confronting the issue that some NodeJS globals aren't available in a React Native environment ('Buffer' in my case). Something calls into the core-utils-is module, which references Buffer.isBuffer and Buffer is not defined. So unless there's a better suggestion it seems I need to look for some workaround. Basically the module I am trying to include references JSZip and I think that won't work in React Native as it uses NodeJS buffers (I guess :)).

any news fixes for this problem!?!

Node js have group of possible folders that can contain modules. When you install one module sometimes module can be dependent to other modules. You have to install this dependancies manual , npm doesn't do that automatically. For example if the error is like /Users/node_modules/module you have to install "npm install -S module". It is showing error as missing path in /Users/node_modules because this is the last element of array full with possible paths that can contain modules (for MAC).
Full list of paths by OS : https://www.npmjs.com/package/npm-paths

After upgrading my project to RN 0.31, the most annoying bug - 4968 came back. Again, I have removed all of the node modules, cleared watchman and run package reset. It's still happening. What makes it more weird is that it's react native that cannot resolve itself :
Unable to resolve module react/lib/ReactNative from [path to node_modules] /node_modules/react-native/Libraries/react-native/react-native.js
Not sure if it's the upgrade failing. Any ideas?

Having this issue too, RN0.31, Node 6.3, I've tried everything but re-init'ing my project.

@Twitchkidd I think this one might help you (I'm working through it now) - 7686

@nazywamsiepawel The only new thing I saw was to switch to React 15.0.2 because the person was using an older version, but I'm using 15.2.1, and I'm calling import React, { Component } from 'react' on every .js file.

Sometimes it's our problem. I had used
- rm -rf node_modules && npm install Reset packager cache - rm -fr $TMPDIR/react-* or node_modules/react-native/packager/packager.sh --reset-cache Clear watchman watches - watchman watch-del-all
No use.
Then I finally found my code "import xx from myPath" is not right.
'myPath' have a wrong word. So it cause my half an hour.

I am wondering why facebook has not resolved this problem since 2015...

I'm was struggling with this issue for the past week on every project, even just testing exporting a super simple module/js file.
I was close to researching options outside of react native, but finally decided I was going to uninstall node and npm and reinstall from scratch to see if that might work.  It did!
I used the following instructions: http://stackoverflow.com/questions/11177954/how-do-i-completely-uninstall-node-js-and-reinstall-from-beginning-mac-os-x

@lindsayosco did the version you were using of Node/NPM change with the reinstall?

@PaulBGD  Yes.  I was on an earlier version of node (not sure the exact one... node 5 something).  Not sure what version of npm.  Wish I had paid more attention, but wasn't even really expecting it to work.
With the reinstall, I'm now on node 6.2.0 and npm 3.8.9.

Gosh, this is not minor. Ever since i somehow dropped into this rabbit hole i have several pretty critical (to my livelihood) RN projects that are halted until i find a way to resolve it.
I have literally tried everything in this thread in sequence 4+ times each with no change in symptoms, I am wondering if i will soon wake to realize this is one of those special kind of nightmares only web developers have.

If all else fails, it's likely that some dependency you've specified in your package.json can't be compiled. (Or well transpiled?) That can also throw this error and it can be maddening.
Sent from my iPhone

On Aug 24, 2016, at 8:09 PM, Kyle Chamberlain<EMAIL_ADDRESS>wrote:
Gosh, this is not minor. Ever since i somehow dropped into this rabbit hole i have several pretty critical (to my livelihood) RN projects that are halted until i find a way to resolve it.
I have literally tried everything in this thread in sequence 4+ times each with no change in symptoms, I am wondering if i will soon wake to realize this is one of those special kind of nightmares only web developers have.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.

@martinbigio if I can get some code that runs fine on 0.19 but has this error on the latest version would that be helpful for solving this?

For anyone having this issue on a mac - this is my go to fix:   https://github.com/GantMan/mobile-commander/blob/master/bin/newclear.sh

I tried all the suggestions here (except converting to ES6), including the "nuclear option" (see above) and still get the "Unable to find this module in its module map or any of the node_modules directories under /Users/node_modules/crypto and its parent directories"  (with crypto like @ambarc )
I'm going to keep trying things for a while longer.
Versions:
react-native-cli: 1.0.0
react-native: 0.32.0
node --version
v6.5.0
Latest OS X/macOS: 10.11.6

I think the problem may be with some of the npm modules interacting with the directory search code, specifically with what files are expected in the directory.  With at least some modules, you can create a completely new project, add the require and get the error message.
e.g.  Just adding (1) or (2) to a completely new project gives the error:

import {
crypto
} from 'crypto';
Crypto = require('crypto');

npm ls
shows crypto installed:
<EMAIL_ADDRESS>/Users//Developer/testrn/test2            [ is my user name  ]
├──<EMAIL_ADDRESS>├─┬<EMAIL_ADDRESS>...etc
Obviously the reason it quits in this spot
/Users/node_modules/crypto
is because that "/Users/node_modules/" directory doesn't exist in the paths it is checking.
npm-paths does indeed show it checking in the right spots:
var paths = require('npm-paths');
console.log(paths());

yields:
[ '/Users//Developer/testrn/test2/node_modules',
'/Users//Developer/testrn/node_modules',
'/Users//Developer/node_modules',
'/usr/local/lib/node_modules',
'/Users//node_modules',
'/usr/lib/node_modules',
'/Users/node_modules',
'/node_modules' ]
The directory is clearly there:
/Users//Developer/testrn/test2/node_modules/crypto
So I think that rn is checking for something like:
/Users//Developer/testrn/test2/node_modules/crypto/index.js
(or files listed in the package.json file?).
Since there is no index.js nor is there a files section in the package.json in crypto, it fails (at least for crypto).
For the crypto module if you rename, say, md5.js to index.js (or duplicate it), the error goes away.
I haven't traced it through "ResolutionRequest.js" etc but I am wondering if it isn't expecting either something listed in the files section or to have a file named index.js in the directory and that could be why crypto fails since crypto has nothing listed in the "files" section of package.json and no index.js.  While creating an index.js "fixes" the error.
Unfortunately, I am out of time to trace it further tonight.

If you trace the code in ResolutionRequest.js (inside react-native/packager/react-packager/src/node-haste/DependencyGraph/ -- hopefully no typos there) you can see what it is looking for when it searches for Crypto.
So at least in the crypto module case, the problem would seem to be not having an index.js.  I am not sure about other modules where this occurs, but it could be something to check if you are getting this error.

loadAsFile:/Users/me/Developer/testrn/test2/node_modules/react-native
loadAsDir:/Users/me/Developer/testrn/test2/node_modules/react-native
loadAsFile:/Users/me/Developer/testrn/test2/node_modules/react
> loadAsFile:/Users/me/Developer/testrn/test2/node_modules/crypto
loadAsDir:/Users/me/Developer/testrn/test2/node_modules/react
> loadAsDir:/Users/me/Developer/testrn/test2/node_modules/crypto
loadAsFile:/Users/me/Developer/testrn/test2/node_modules/react-native/Libraries/react-native/react-native.js
loadAsFile2:/Users/me/Developer/testrn/test2/node_modules/react-native/Libraries/react-native/react-native.js
loadAsFile:/Users/me/Developer/testrn/test2/node_modules/react/react.js
loadAsFile2:/Users/me/Developer/testrn/test2/node_modules/react/react.js
> loadAsFile:/Users/me/Developer/testrn/test2/node_modules/crypto/index
loadAsFile2:/Users/me/Developer/testrn/test2/node_modules/crypto/index.js
loadAsFile:/Users/me/Developer/testrn/test2/node_modules/react/lib/React
loadAsFile2:/Users/me/Developer/testrn/test2/node_modules/react/lib/React.js
loadAsFile:/Users/me/Developer/testrn/test2/node_modules/react-native/Libraries/react-native/node_modules/fbjs/lib/warning
...

loadAsFile is checking around line 393 (start of loadAsFile)
loadAsFile: line 445 (just before the return this. in loadAsFile)
loadAsDir: line 452 (start of loadAsDir)

So the TLDR; summary of what looks like at least one of the causes of the issue is:
if the module directory is missing (1) index.js, (2) perhaps index.node, AND (3) the package.json does not include a "main:" entry like this:

{ "name" : "some-library",
"main" : "./lib/some-library.js" }

the module is not found and the error above is returned. And the error is returned showing that directory because most installations don't have that /Users/node_modules/  directory and so it errors out of the search there.
For crypto, it would be in a directory like this:
/Users/me/Developer/test2/node_modules/crypto

I'm pretty sure #9832 will fix this issue.

LOL, just noticed I got 3 thumbs down for sharing my solution of how I clear cache... Ummm ok.   I guess I'll just keep my solution to myself then?

My Solution:

watchman watch-del-all
rm -rf $TMPDIR/react-packager-*
npm cache clean && npm install
-->At this step you maybe see:
npm WARN<EMAIL_ADDRESS>requires a peer of<EMAIL_ADDRESS>but none was installed.
Notes that version at type: npm i<EMAIL_ADDRESS>-save
Done! just re-run and problem gone!

Hope this help

Switching to npm 3 was the only thing that helped to resolve the issue

For me, when loading my own components, this was happening because I had used the .jsx extension and React Native was looking for .js for some reason!

The moment I add the following to index.ios.js I receive the above error:
const FBSDK = require('react-native-fbsdk');
const {
LoginButton,
AccessToken
} = FBSDK;

I have tried everythign from this post but still don't understand the reason for this error.
My package.json dependencies:
"dependencies": {
"react": "15.3.1",
"react-native": "0.33.0",
"react-native-fbsdkcore": "0.0.8",
"react-native-fbsdklogin": "0.0.8",
"react-native-fbsdkshare": "0.0.8"
}

any updates?

I also had this problem after updating react-native to 0.34.1
Solved it after

Delete the node_modules folder - rm -rf node_modules
Reset packager cache - rm -fr $TMPDIR/react-* or node_modules/react-native/packager/packager.sh --reset-cache
npm cache clean
Killing the packager terminal and all open emulators
npm install

I have a bash script like this:
rm -rf node_modules
npm cache clean
npm install
rm -fr $TMPDIR/react-*
watchman watch-del-all
node_modules/react-native/packager/packager.sh --reset-cache

I kill the packager and emulator before running this, and my project still doesn't work. What am I doing wrong? What else can I do? I have been trying to make this work for 2 days now. The dependency that started it all is deepstream.io-client-js.

In my case the problem was with the package. The package.json has a "browser": {"net": false} field and its Gruntfile.js has ignore: [ './src/tcp/tcp-connection.js' ] option set for browserify. I guess react-native does not understand these options and tries to build and use node version, and it fails. I have removed this check:
if( utils.isNode ) {
		this._endpoint = new TcpConnection( this._url );

and tcp requirement from deepstream.io-client-js/src/message/connection.js
It's a bit hacky but it works now.

Tailing on to this thread for search engine visitors (and for perhaps for future me), this appears to be related; I was hitting an error when running mocha in watch mode (--watch):
Error: ENOENT: no such file or directory, stat '/Users/<username>/Projects/<projectname>/ios/build/ModuleCache/2OOEZK7ULMT9F/_Builtin_intrinsics-1QSLWXKIZ9CUS.pcm.lock'

The work-around that worked for me was running:
rm -rf ios/build/ModuleCache/*

Print: Entry, ":CFBundleIdentifier", Does Not Exist

I am seeing the Unable to resolve module... issue too. I've tried the recommended:
watchman watch-del-all
rm -rf node_modules && npm install
rm -fr $TMPDIR/react-*

Node: 6.2.2
npm: 2.15
I tried upgrading to the latest npm 3.10.9, and that didn't help either.
I also tried @GantMan's shell script.
I'm not sure where to go from here.  Any help would be appreciated.

@austinkelleher did you killed all processes running at port 8081?
lsof -n -i4TCP:8081

Thanks for reaching out @abimelex. I tried that / restarting my computer with both npm 2.15 and 3.10.9. No luck.


Delete set-interrupts.sh

This file doesn't get used

I think we should use set-interrupts.sh for gcp local ssds. https://cloud.google.com/compute/docs/disks/local-ssd#runscript
Ubuntu didn't set interrupts by default.

Talked offline, LGTM


dbt: 1.8.2 -> 1.8.5

Automatic update generated by nixpkgs-update tools. This update was made based on information from passthru.updateScript.
meta.description for dbt is: Enables data analysts and engineers to transform their data using the same practices that software engineers use to build applications
meta.homepage for dbt is: https://github.com/dbt-labs/dbt-core
meta.changelog for dbt is: https://github.com/dbt-labs/dbt-core/blob/v1.8.4/CHANGELOG.md
Updates performed

Ran passthru.UpdateScript

To inspect upstream changes
Impact
Checks done

built on NixOS
The tests defined in passthru.tests, if any, passed
found 1.8.4 with grep in /nix/store/06fdaj425vxkn4kayszmq0akb5id25mw-python3.12-dbt-core-1.8.4
found 1.8.4 in filename of file in /nix/store/06fdaj425vxkn4kayszmq0akb5id25mw-python3.12-dbt-core-1.8.4

Rebuild report (if merged into master) (click to expand)

12 total rebuild path(s)

12 package rebuild(s)

First fifty rebuilds by attrpath

dbt
python311Packages.dbt-bigquery
python311Packages.dbt-core
python311Packages.dbt-postgres
python311Packages.dbt-redshift
python311Packages.dbt-snowflake
python312Packages.dbt-bigquery
python312Packages.dbt-core
python312Packages.dbt-postgres
python312Packages.dbt-redshift
python312Packages.dbt-snowflake

Instructions to test this update (click to expand)

Either download from Cachix:
nix-store -r /nix/store/06fdaj425vxkn4kayszmq0akb5id25mw-python3.12-dbt-core-1.8.4 \
  --option binary-caches 'https://cache.nixos.org/ https://nix-community.cachix.org/' \
  --option trusted-public-keys '
  nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=
  cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=
  '

(The Cachix cache is only trusted for this store-path realization.)
For the Cachix download to work, your user must be in the trusted-users list or you can use sudo since root is effectively trusted.
Or, build yourself:
nix-build -A dbt https://github.com/r-ryantm/nixpkgs/archive/dfe60e2a13e627f10712fea3a022f4287b9b69f1.tar.gz

Or:
nix build github:r-ryantm/nixpkgs/dfe60e2a13e627f10712fea3a022f4287b9b69f1#dbt

After you've downloaded or built it, look at the files and if there are any, run the binaries:
ls -la /nix/store/06fdaj425vxkn4kayszmq0akb5id25mw-python3.12-dbt-core-1.8.4
ls -la /nix/store/06fdaj425vxkn4kayszmq0akb5id25mw-python3.12-dbt-core-1.8.4/bin

Pre-merge build results
We have automatically built all packages that will get rebuilt due to
this change.
This gives evidence on whether the upgrade will break dependent packages.
Note sometimes packages show up as failed to build independent of the
change, simply because they are already broken on the target branch.
Result of nixpkgs-review run on x86_64-linux 1

20 packages built:

dbt (python312Packages.dbt-core)
dbt.dist (python312Packages.dbt-core.dist)
python311Packages.dbt-bigquery
python311Packages.dbt-bigquery.dist
python311Packages.dbt-core
python311Packages.dbt-core.dist
python311Packages.dbt-postgres
python311Packages.dbt-postgres.dist
python311Packages.dbt-redshift
python311Packages.dbt-redshift.dist
python311Packages.dbt-snowflake
python311Packages.dbt-snowflake.dist
python312Packages.dbt-bigquery
python312Packages.dbt-bigquery.dist
python312Packages.dbt-postgres
python312Packages.dbt-postgres.dist
python312Packages.dbt-redshift
python312Packages.dbt-redshift.dist
python312Packages.dbt-snowflake
python312Packages.dbt-snowflake.dist

Maintainer pings
cc @mausch @tjni for testing.

Automatic update generated by nixpkgs-update tools. This update was made based on information from passthru.updateScript.
meta.description for dbt is: Enables data analysts and engineers to transform their data using the same practices that software engineers use to build applications
meta.homepage for dbt is: https://github.com/dbt-labs/dbt-core
meta.changelog for dbt is: https://github.com/dbt-labs/dbt-core/blob/v1.8.5/CHANGELOG.md
Updates performed

Ran passthru.UpdateScript

To inspect upstream changes
Impact
Checks done

built on NixOS
The tests defined in passthru.tests, if any, passed
found 1.8.5 with grep in /nix/store/1bhx003izrdblyiqj4z4rd0sxhpxy6wm-python3.12-dbt-core-1.8.5
found 1.8.5 in filename of file in /nix/store/1bhx003izrdblyiqj4z4rd0sxhpxy6wm-python3.12-dbt-core-1.8.5

Rebuild report (if merged into master) (click to expand)

12 total rebuild path(s)

12 package rebuild(s)

First fifty rebuilds by attrpath

dbt
python311Packages.dbt-bigquery
python311Packages.dbt-core
python311Packages.dbt-postgres
python311Packages.dbt-redshift
python311Packages.dbt-snowflake
python312Packages.dbt-bigquery
python312Packages.dbt-core
python312Packages.dbt-postgres
python312Packages.dbt-redshift
python312Packages.dbt-snowflake

Instructions to test this update (click to expand)

Either download from Cachix:
nix-store -r /nix/store/1bhx003izrdblyiqj4z4rd0sxhpxy6wm-python3.12-dbt-core-1.8.5 \
  --option binary-caches 'https://cache.nixos.org/ https://nix-community.cachix.org/' \
  --option trusted-public-keys '
  nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=
  cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=
  '

(The Cachix cache is only trusted for this store-path realization.)
For the Cachix download to work, your user must be in the trusted-users list or you can use sudo since root is effectively trusted.
Or, build yourself:
nix-build -A dbt https://github.com/r-ryantm/nixpkgs/archive/6ee96f85080cd34bfd604ba2b06e029ac6ab84ed.tar.gz

Or:
nix build github:r-ryantm/nixpkgs/6ee96f85080cd34bfd604ba2b06e029ac6ab84ed#dbt

After you've downloaded or built it, look at the files and if there are any, run the binaries:
ls -la /nix/store/1bhx003izrdblyiqj4z4rd0sxhpxy6wm-python3.12-dbt-core-1.8.5
ls -la /nix/store/1bhx003izrdblyiqj4z4rd0sxhpxy6wm-python3.12-dbt-core-1.8.5/bin

Pre-merge build results
We have automatically built all packages that will get rebuilt due to
this change.
This gives evidence on whether the upgrade will break dependent packages.
Note sometimes packages show up as failed to build independent of the
change, simply because they are already broken on the target branch.
Result of nixpkgs-review run on x86_64-linux 1

20 packages built:

dbt (python312Packages.dbt-core)
dbt.dist (python312Packages.dbt-core.dist)
python311Packages.dbt-bigquery
python311Packages.dbt-bigquery.dist
python311Packages.dbt-core
python311Packages.dbt-core.dist
python311Packages.dbt-postgres
python311Packages.dbt-postgres.dist
python311Packages.dbt-redshift
python311Packages.dbt-redshift.dist
python311Packages.dbt-snowflake
python311Packages.dbt-snowflake.dist
python312Packages.dbt-bigquery
python312Packages.dbt-bigquery.dist
python312Packages.dbt-postgres
python312Packages.dbt-postgres.dist
python312Packages.dbt-redshift
python312Packages.dbt-redshift.dist
python312Packages.dbt-snowflake
python312Packages.dbt-snowflake.dist

Maintainer pings
cc @mausch @tjni for testing.

Add a :+1: reaction to pull requests you find important.

Automatic update generated by nixpkgs-update tools. This update was made based on information from passthru.updateScript.
meta.description for dbt is: Enables data analysts and engineers to transform their data using the same practices that software engineers use to build applications
meta.homepage for dbt is: https://github.com/dbt-labs/dbt-core
meta.changelog for dbt is: https://github.com/dbt-labs/dbt-core/blob/v1.8.6/CHANGELOG.md
Updates performed

Ran passthru.UpdateScript

To inspect upstream changes
Impact
Checks done

built on NixOS
The tests defined in passthru.tests, if any, passed
found 1.8.6 with grep in /nix/store/flz5ih5880fici39y19nrgzalfiwildi-python3.12-dbt-core-1.8.6
found 1.8.6 in filename of file in /nix/store/flz5ih5880fici39y19nrgzalfiwildi-python3.12-dbt-core-1.8.6

Rebuild report (if merged into master) (click to expand)

12 total rebuild path(s)

12 package rebuild(s)

First fifty rebuilds by attrpath

dbt
python311Packages.dbt-bigquery
python311Packages.dbt-core
python311Packages.dbt-postgres
python311Packages.dbt-redshift
python311Packages.dbt-snowflake
python312Packages.dbt-bigquery
python312Packages.dbt-core
python312Packages.dbt-postgres
python312Packages.dbt-redshift
python312Packages.dbt-snowflake

Instructions to test this update (click to expand)

Either download from Cachix:
nix-store -r /nix/store/flz5ih5880fici39y19nrgzalfiwildi-python3.12-dbt-core-1.8.6 \
  --option binary-caches 'https://cache.nixos.org/ https://nix-community.cachix.org/' \
  --option trusted-public-keys '
  nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=
  cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=
  '

(The Cachix cache is only trusted for this store-path realization.)
For the Cachix download to work, your user must be in the trusted-users list or you can use sudo since root is effectively trusted.
Or, build yourself:
nix-build -A dbt https://github.com/r-ryantm/nixpkgs/archive/a0c719fd33d5e48b867d3496bff956e54a302070.tar.gz

Or:
nix build github:r-ryantm/nixpkgs/a0c719fd33d5e48b867d3496bff956e54a302070#dbt

After you've downloaded or built it, look at the files and if there are any, run the binaries:
ls -la /nix/store/flz5ih5880fici39y19nrgzalfiwildi-python3.12-dbt-core-1.8.6
ls -la /nix/store/flz5ih5880fici39y19nrgzalfiwildi-python3.12-dbt-core-1.8.6/bin

Pre-merge build results
We have automatically built all packages that will get rebuilt due to
this change.
This gives evidence on whether the upgrade will break dependent packages.
Note sometimes packages show up as failed to build independent of the
change, simply because they are already broken on the target branch.
Result of nixpkgs-review run on x86_64-linux 1

20 packages built:

dbt (python312Packages.dbt-core)
dbt.dist (python312Packages.dbt-core.dist)
python311Packages.dbt-bigquery
python311Packages.dbt-bigquery.dist
python311Packages.dbt-core
python311Packages.dbt-core.dist
python311Packages.dbt-postgres
python311Packages.dbt-postgres.dist
python311Packages.dbt-redshift
python311Packages.dbt-redshift.dist
python311Packages.dbt-snowflake
python311Packages.dbt-snowflake.dist
python312Packages.dbt-bigquery
python312Packages.dbt-bigquery.dist
python312Packages.dbt-postgres
python312Packages.dbt-postgres.dist
python312Packages.dbt-redshift
python312Packages.dbt-redshift.dist
python312Packages.dbt-snowflake
python312Packages.dbt-snowflake.dist

Maintainer pings
cc @mausch @tjni for testing.

[!TIP]
As a maintainer, if your package is located under pkgs/by-name/*, you can comment @NixOS/nixpkgs-merge-bot merge to automatically merge this update using the nixpkgs-merge-bot.

Add a :+1: reaction to pull requests you find important.

Built and ran dbt --help on aarch64-darwin.


Add a Search Analytics dashboard

There is currently no search data, and the current core does not know whether it supports the development of search analysis dashboards:
refer to： https://roadmap.meilisearch.com/c/129-search-analytics

@Avey777 Thx!
The feature mentioned in the link needs to integrate server related functions to achieve, at this stage, the application is only considered to be used in the pure client scenario, and cannot realize the search request analysis features.


Rebuild docs for preview7

Fixed up links to types that have changed like ClusterData.
Added the warning about HttpClient, fixes #458
General rebuild to pick up preview7 changes.
Make sure the edit links point to release/docs, fixes #515

The interesting changes can be reviewed by looking at the separate commits.

Merging to complete the release.


HSTRING usage in UWP renderer

We need to go over our HSTRING usage and make sure that we are properly handling the memory associated with the HSTRINGs.

Fix here https://github.com/Microsoft/AdaptiveCards/pull/1248


BLIP Tokenizer max_length

Many thanks for sharing the code.
I was wondering why you're calling the tokenizer with max_length=35? Is there anything preventing me from relaxing this limit?
(Also noticed that for CLIPScore you don't impose the same limitation)

Calling the tokenizer with max_length=35 is just to keep the same as settings of BLIP at https://github.com/salesforce/BLIP/blob/main/eval_retrieval_video.py#LL49C59-L49C59, it's worth trying relaxing the limit.

Understood. Thanks for the pointer.


CI is gone

It seems that Travis has shut down?
We need to move this repo to Github Actions.

I was poking at my travis settings and probably broke this, sorry. but yes travis-ci.org is being shut down. people should migrate to travis-ci.com . the latter has monthly quotas for macOS builds though.
we should move to GitHub Actions, IMO

I was talking to Henrik (that is also helping on RTIC) and we will fix it over to GHA over the coming days :)


java code generation issues

Hello, I've been trying to generate java validation code with pgv, however I get this error:
grpc/SignalConfigServicePatchRequestValidator.java:55: error: cannot find symbol
                        io.envoyproxy.pgv.RepeatedValidation.forEach(proto.getBitOffsetsList(), item -> {

I get this error on all the files that are being generated. My pgv plugin config is set as
def grpcVersion = '1.37.0' // CURRENT_GRPC_VERSION
def protobufVersion = '3.15.0'
def protocVersion = protobufVersion

dependencies {
    implementation "io.grpc:grpc-protobuf:${grpcVersion}"
    implementation "io.grpc:grpc-stub:${grpcVersion}"
    compileOnly "org.apache.tomcat:annotations-api:6.0.53"

    // examples/advanced need this for JsonFormat
    implementation "com.google.protobuf:protobuf-java-util:${protobufVersion}"

    runtimeOnly "io.grpc:grpc-netty-shaded:${grpcVersion}"

    testImplementation "io.grpc:grpc-testing:${grpcVersion}"
    testImplementation "junit:junit:4.12"
    testImplementation "org.mockito:mockito-core:3.4.0"
}

protobuf {
    protoc { artifact = "com.google.protobuf:protoc:${protocVersion}" }
    plugins {
        grpc { artifact = "io.grpc:protoc-gen-grpc-java:${grpcVersion}" }
        javapgv {
            artifact = "io.envoyproxy.protoc-gen-validate:protoc-gen-validate:0.4.1"
        }
    }
    generateProtoTasks {
        all()*.plugins {
            grpc {}
            javapgv {
                option "lang=java"
//                outputSubDir = 'java'
            }
        }
    }
}

I am using version 0.4.1 (since the latest release at this time - 0.6.1 is not yet available on mavencentral)
I've actually picked the validate.proto file from the 0.4.1 tag. I am not sure if there is anything I am doing wrong, or if it is a bug.
Incase it turns out to be a bug, while I will need some guidance, I am happy to submit a PR to fix :)
Cheers

Hello, I want to know if there is an update on this? If there is someway I can help out, please let me know, I would love to assist.

EDIT: I solved this, turns out in my build.gradle I missed implementation "io.envoyproxy.protoc-gen-validate:pgv-java-stub:${pgvVersion}"


Not working with Angular 2

I'm trying this on Angular 2 project. I could prepare a demo project.
Seems to be related with Zone.js which is adding some event listeners and for XDomainRequest may not be working fine.
              data.target.addEventListener('readystatechange', function () {
                if (data.target.readyState === XMLHttpRequest.DONE) {
                    if (!data.aborted) {
                        task.invoke();
                    }
                }
            });

This is the error for reference:
LOG: EXCEPTION: TypeError: Object doesn't support property or method 'addEventListener'
LOG: EXCEPTION: TypeError: Object doesn't support property or method 'addEventListener'
LOG: EXCEPTION: Error: Uncaught (in promise): TypeError: Object doesn't support property or method 'addEventListener'
Unhandled Promise rejection:Object doesn't support property or method 'addEventListener'; Zone:angular; Task:Promise.then; Value:TypeError: Object doesn't support property or method 'addEventListener'
Error: Uncaught (in promise): TypeError: Object doesn't support property or method 'addEventListener'

I think the offending code that uses it and crash is these line in @angular/http:
            _xhr.addEventListener('load', onLoad);
            _xhr.addEventListener('error', onError);
            _xhr.send(_this.request.text());

Would love to hear if you get this working @lcrodriguez

@briananderson1222 I did. I had to tweak the adapter a bit. I will create a PR soon.

I've created a PR for this issue:
https://github.com/intuit/xhr-xdr-adapter/pull/8

@briananderson1222 : could you confirm whether the PR from @lcrodriguez works for you? I don't use Angular 2 and haven't had the issue that it's trying to fix. It would be super helpful if you could test it.

@yanni858 The pull request that @lcrodriguez made worked for a project that I'm working on in Angular 4.

@lcrodriguez - thanks for your PR, @ryanpetris thanks for the confirmation. merged.


Can't open scratch orgs that were created last week

Summary
Can't open scratch orgs that were created last week.  I have a number of scartch orgs that were created last week.  I was using them fine on Friday (1/3/2020).  This morning (1/6/2020) when I try "sfdx force:org:open" on any of these orgs the command line hangs indefinitely.  If I create a new scratch org I can open it with any problem.
Steps To Reproduce:

sfdx force:org:open - <some org that was created 1/3/2020 or prior>

Expected result
Org should open in the browser
Actual result
The command line hangs indefinitely.
Additional information
I also tried the -r option to try just getting the url and that hangs too
SFDX CLI Version(to find the version of the CLI engine run sfdx --version):
sfdx-cli/7.37.1 win32-x64 node-v10.15.0
SFDX plugin Version(to find the version of the CLI plugin run sfdx plugins --core)
@oclif/plugin-commands 1.2.3 (core)
@oclif/plugin-help 2.2.3 (core)
@oclif/plugin-not-found 1.2.3 (core)
@oclif/plugin-plugins 1.7.9 (core)
@oclif/plugin-update 1.3.9 (core)
@oclif/plugin-warn-if-update-available 1.7.0 (core)
@oclif/plugin-which 1.0.3 (core)
@salesforce/sfdx-trust 3.0.7 (core)
analytics 1.2.2 (core)
generator 1.1.2 (core)
salesforcedx 47.10.1
├─ salesforcedx-templates 47.11.0
└─ salesforce-alm 47.11.0
OS and version:
Window 10

We saw the same thing earlier today - strangely there was one member of the team who was unaffected. They were signed out of the dev hub and when they signed back in again they could access their existing scratch orgs. The rest of us (5 people) lost access to all of them.

I have also seen similar behavior over the weekend

same issue here for all of my existing scratch orgs.

I had the same issue.
I don't know what pod I was on but do you think it is possible that scratch orgs on the now Spring '20 pods didn't survive the upgrade?

Thanks for reporting everyone.  There hasn't been any CLI changes for several weeks but as was pointed out in this thread there was an update over the weekend, which seems to be causing the problem.
This will be better handled as a support case.  Could one of you please contact support to start that process?  I will close this issue as being tracked internally.
Thanks all!

Case #25282353

FWIW, this seems to have been fixed for us. We can open scratch orgs that were created last week

yep, working for me now, too. still can't create a new scratch org on the preview release, but there's another issue here for that.


Publish report in github actions flow

https://github.com/marketplace/actions/netlify-deploy-action

@vitaly-dukhov  are there variables with
netlify-auth-token: ${{ **secrets.NETLIFY_AUTH_TOKEN** }}
          netlify-site-id: ${{ **secrets.NETLIFY_SITE_ID** }}

I can insert this block in CI


arm : DobbyHook

On macOS, ARM architecture, the tmp parameter in the DobbyHook function call must be passed a valid non-null,  value, otherwise it will result in an error. However, on the x86 architecture, passing a null  value for tmp does not cause an error.
DobbyHook((void *)_sub_0x10030b9a5, ret, &tmp);

Regarding the ARM environment:
Introducing a .dylib can cause this problem, but introducing a .a does not have this issue.