Error: Cannot find module 'C:\Users\satyen\Desktop\ExpoGame\react-native.config.js'
Require stack:
C:\Users\satye\node_modules\react-native-asset\lib\cli.js
I'm trying to use custom fonts for react-native but I'm keep getting this error even though I made config file and globally installed react-native-assets still its not going.
Related
I am new to development in reactJS. I would like to implement a live chat in my website and I have relied on react-chat-elements.
It gives me the error:
Could not find a declaration file for module 'react-chat-elements'.
I tried npm i --save-dev #types/react-chat-elements but the error does not go away
I am trying to compile my first React Native project, and it all works fine from the CLI, until I try to install a new library.
After installing any library, I get various errors, culminating in this:
error: bundling failed: Error: While trying to resolve module `react` from file `/Users/myname/Desktop/Projects/ProjectName/App.js`, the package `/Users/myname/Desktop/Projects/ProjectName/node_modules/react/package.json` was successfully found. However, this package itself specifies a `main` module field that could not be resolved (`/Users/myname/Desktop/Projects/ProjectName/node_modules/react/index.js`. Indeed, none of these files exist:
I have, indeed, confirmed that those files exist.
What is going on here? I'm constantly having these errors as I am trying to use React Native, even when rebuilding the app multiple times and trying over.
Do the following steps:
Stop metro bundler
Delete node_modules folder
cd into your project folder and run:
'npm install'
I have created the package for learning purpose nik-drop presently available in npm.
now testing purpose I tried to use that package in my another demo project but when I try to use this package from npm-moduls. I unable to access that package.
Even through Package is available in node-module folder.
import DropDownMob from 'nik-drop';
I'm getting error
Module not found: Can't resolve 'nik-drop' in '/home/nikhil/Documents/React-Project/sec/sec/src'
This is not node module path, react trying to access it from local directory.
How can I resolve it.
I'm writing react-native application and using npm module #waves/signature-adapter. When I make import { Seed } from '#waves/signature-generator'; compiler returns an error undefined is not a constructor (evaluating 'new __1.Base58('senderPublicKey')'). At first I thought the way I imported the lib was wrong but then I tried to do the same for new react application (not react-native) and it is imported and works with no errors.
The module is written in typescript but I'm not sure it really matters cause my app uses lots of other modules written in typescript. I try to understand what's wrong cause I have same-same code in both apps, but it gives the error in react-native.
The reason was the lib used native node.js modules which react-native didn't support. I had to make a patch using patch-package to solve the problem.
The problem is
[11:16:06] TypeScript: 103 semantic errors
[11:16:06] TypeScript: emit succeeded (with errors)
I am using node v5.7.0 and npm 3.6.0
gulp -v:
[11:26:58] Requiring external module babel-register
[11:26:58] CLI version 3.9.1
[11:26:58] Local version 3.9.1
I am total begginer with babel on gulp.
I generated the files under ubuntu 15.10 with yo 1.6.0 using
generator-modern-web-dev in fresh folder.
The errors are like
app/test/sanity_test.spec.ts(2,1): error TS2304: Cannot find name 'describe'.
app/test/sanity_test.spec.ts(3,2): error TS2304: Cannot find name 'it'.
app/test/sanity_test.spec.ts(4,3): error TS2304: Cannot find name 'expect'.
app/test/sanity_test.spec.ts(7,2): error TS2304: Cannot find name 'xit'.
app/test/sanity_test.spec.ts(8,3): error TS2304: Cannot find name 'expect'.
/home/danielduel/Pulpit/server/node_modules/angular2/platform/browser.d.ts(77,90): error TS2304: Cannot find name 'Promise'.
then... more errors. (I can post it, if it is very critical to see all the 103 errors)
I was reinstaling sudo npm install npm_modules with success, but it was not fixed what I aam dealing with.
Then, task "scripts-javascript-dist" from
[11:16:09] 'scripts-javascript-dist' errored after 3.31 s
[11:16:09] Error: Error on fetch for npm:angular2#2.0.0-beta.7/bootstrap.js at file:///home/danielduel/Pulpit/server/jspm_packages/npm/angular2#2.0.0-beta.7/bootstrap.js
Can you lead me to fix this problems?
I can add source codes of tasks, but they are done over abstract ES2015 architecture and it depends on many files, but if its needed - give me the info.
StackOverflow threads that I was trying and looks at least fammiliar:
module not found angular, generates more errors
this one looks good, but I do not understand at all
this one, with config is not working as fix, generates more errors
I think, I am missing something, but I can't recognize what.
You should never need to sudo npm install locally!
From the errors you presented, it looks to me as if the project doesn't have all required type definitions, especially these for the test code. This could be caused by some invalid project setup or by incorrect references inside the included modules.
Please check if you have tsd or typings in your project and install the missing type definitions for (I assume) jasmine.
https://github.com/typings/typings (new)
http://definitelytyped.org/tsd/ (deprecated)
https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/jasmine/jasmine.d.ts
It's hard to say if this is the solution in your case, but I hope this helps you tracking down the root cause.