Skip to content
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.

Failed to install #16

Closed
nolife08021 opened this issue Nov 14, 2019 · 27 comments
Closed

Failed to install #16

nolife08021 opened this issue Nov 14, 2019 · 27 comments

Comments

@nolife08021
Copy link

nolife08021 commented Nov 14, 2019

Failed to install with "npm install --save react-native-math-view"

npx: installed 1 in 2.895s
error TS5023: Unknown compiler option 'downlevelIteration'.
error TS5023: Unknown compiler option 'lib'.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] compile: npx tsc
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] compile script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?

npm ERR! A complete log of this run can be found in:
npm ERR! /Users/admin/.npm/_logs/2019-11-18T02_56_23_447Z-debug.log
fs.js:114
throw err;
^

Error: ENOENT: no such file or directory, copyfile '/Users/admin/myMathProject/node_modules/mathjax-full/ts/input/tex/mhchem/mhchem_parser.js' -> '/Users/admin/myMathProject/node_modules/mathjax-full/js/input/tex/mhchem/mhchem_parser.js'
at Object.copyFileSync (fs.js:1728:3)
at Object. (/Users/admin/myMathProject/node_modules/react-native-math-view/scripts/compileMathjax.js:22:4)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)

Error: [email protected] postinstall: node ./scripts/compileMathjax && tsc
Exit status 1
at EventEmitter. (/usr/local/lib/node_modules/npm/node_modules/npm-
lifecycle/index.js:301:16)
at EventEmitter.emit (events.js:198:13)
at ChildProcess. (/usr/local/lib/node_modules/npm/node_modules/npm-
lifecycle/lib/spawn.js:55:14)
at ChildProcess.emit (events.js:198:13)
at maybeClose (internal/child_process.js:982:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
pkgid [email protected]

@joaortizro
Copy link

joaortizro commented Nov 14, 2019

Apparently i did have a problem with mathjax-full , i've tried to add it but still same error

Error: ENOENT: no such file or directory, copyfile '/home/kib/Projects/KIB/kibApp/node_modules/mathjax-full/ts/input/tex/mhchem/mhchem_parser.js' -> '/home/kib/Projects/KIB/kibApp/node_modules/mathjax-full/js/input/tex/mhchem/mhchem_parser.js' at Object.copyFileSync (fs.js:1731:3) at Object.<anonymous> (/home/kib/Projects/KIB/kibApp/node_modules/react-native-math-view/scripts/compileMathjax.js:22:4) at Module._compile (internal/modules/cjs/loader.js:774:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:785:10) at Module.load (internal/modules/cjs/loader.js:641:32) at Function.Module._load (internal/modules/cjs/loader.js:556:12) at Function.Module.runMain (internal/modules/cjs/loader.js:837:10) at internal/main/run_main_module.js:17:11 { errno: -2, syscall: 'copyfile', code: 'ENOENT', path: '/home/kib/Projects/KIB/kibApp/node_modules/mathjax-full/ts/input/tex/mhchem/mhchem_parser.js', dest: '/home/kib/Projects/KIB/kibApp/node_modules/mathjax-full/js/input/tex/mhchem/mhchem_parser.js' }

@nolife08021
Copy link
Author

@ShaMan123 kindly advice, I really need this, rather than using webview.

@joaortizro
Copy link

@ShaMan123 i've tried Math example from the repo but still same errors, @nolife08021 have you tried the mathExample, may be im missing something out...

@nolife08021
Copy link
Author

@joaortizro I tried just now and this error comes out.

error: bundling failed: Error: Unable to resolve module mathjax-full/js/input/tex/AllPackages from /Users/admin/react-native-math-view/src/mathjax/Config.ts: Module mathjax-full/js/input/tex/AllPackages does not exist in the Haste module map or in these directories:
/Users/admin/react-native-math-view/node_modules/mathjax-full/js/input/tex

@nolife08021
Copy link
Author

nolife08021 commented Nov 18, 2019

@joaortizro I able to run the mathExample now after install mathjax-full and transformation-matrix in react-native-math-view as error log mention. But I still wondering how to install it in my apps.

@ShaMan123
Copy link
Owner

Will look into it.
BTW iOS isn't working yet so file an issue if the fallback component isn't working

@ShaMan123
Copy link
Owner

I tried to reproduce the issue. It is something I ran into before but couldn't reproduce anymore.
To test the issue I installed the package on a new react-native app both with yarn and npm with no trouble.
Just in case I went through the config files for the example app and made them more safe, upgraded react-native and bumped the version.
I suggest you remove all node_modules + lockfile, download again, rebuild example app and see how it goes.
Make sure to follow these instructions
What version of react-native are you using?
If you are using with iOS be sure to add react-native-svg (this is a fallback until I finish linking the native code)
Report back so I can help.

@ShaMan123
Copy link
Owner

@nolife08021 @joaortizro I've added additional info in the ReadME. Suggest you guys give it a look

@ShaMan123
Copy link
Owner

@nolife08021 after installing if the bug persists try running:

cd node_modules/react-native-math-view && npm run postinstall

and report back.
Thanks

@ShaMan123
Copy link
Owner

Might have found the problem. bumped -> 3.4.1

@joaortizro
Copy link

@nolife08021 @ShaMan123 , i've managed to at least run the mathExample but now it seems there are some errors with the hooks

  • node version : 12.4.0
  • react-native-cli: 2.0.1
  • react-native: 0.61.4

1
2

@nolife08021
Copy link
Author

@ShaMan123 I'm facing this error after I removed all node_modules + lockfile and download it again.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] postinstall: `node ./scripts/compileMathjax`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/admin/.npm/_logs/2019-11-19T02_48_35_163Z-debug.log

"react-native": "0.59.5"

@ShaMan123
Copy link
Owner

ShaMan123 commented Nov 19, 2019

@nolife08021 @ShaMan123 , i've managed to at least run the mathExample but now it seems there are some errors with the hooks

Originally posted by @joaortizro in #16 (comment)

Make sure it's not a problem with your environment, see this.

@ShaMan123
Copy link
Owner

ShaMan123 commented Nov 19, 2019

I think that downgrading is not a good idea.

This error is not vital and can be disregarded

@ShaMan123 I'm facing this error after I removed all node_modules + lockfile and download it again.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] postinstall: `node ./scripts/compileMathjax`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/admin/.npm/_logs/2019-11-19T02_48_35_163Z-debug.log

"react-native": "0.59.5"

I've edited the installation guide, make sure to follow the new instructions.

@ShaMan123
Copy link
Owner

ShaMan123 commented Nov 19, 2019

and perhaps try the following:

  1. Clean cache for npm and yarn (sometimes for yarn you need to do it manually by navigating to the cache dir and deleting it)
  2. Reset cache for react-native (npm start -- --reset-cache)
  3. Remove react-native global package (npm uninstall -g react-native)
  4. Stop gradlew / restart your machine.
  5. Make sure to clean and rebuild native code after installation (not enough to run react-native run-android)

@joaortizro
Copy link

joaortizro commented Nov 20, 2019

@ShaMan123 i did follow your new instructions with yarn
i tried 1,2,4, and 5 from #16 (comment)

On step 5 i did ./gradlew clean inside the android folder, i dont know if this is what you mean by clean and rebuild native code to be honest, and still got the error without the compiled mathjax successfully

i will try option 3 asap , since i've other project on it and a bit scared to mess things up

Edit: compiled mathjax successfully message appears when running yarn --production=false on your repo, dont know why with yarn add react-native-math-view fails in my app

@ShaMan123
Copy link
Owner

ShaMan123 commented Nov 21, 2019 via email

@joaortizro
Copy link

@ShaMan123 it was a completely new project

May i ask your react, react-native, react-dom version?

@ShaMan123
Copy link
Owner

 "dependencies": {
+    "react": "16.9.0",
+    "react-native": "0.61.4",
    "react-native-gesture-handler": "^1.5.0",
    "react-native-reanimated": "^1.4.0",
+    "react-native-svg": "^9.13.3"
  },

no need for react-dom. This repo is native only.

example

@joaortizro
Copy link

i've upgraded to react 16.9.0 and native to 0.61.4

image

but yarn add react-native-math-view doesn't show compiled-mathjax-successfuly

i will add the full log generated by npm
2019-11-22T21_15_30_640Z-debug.log

@ShaMan123
Copy link
Owner

Do you have npx installed globally?
If you ignore this error what happens?
Did you read this?

@joaortizro
Copy link

joaortizro commented Nov 24, 2019

ok, so with yarn it does put the folder inside node-modules but when i called it says

Error: Unable to resolve module mathjax-full/js/input/tex/AllPackages from node_modules/react-native-math-view/src/mathjax/Config.ts: mathjax-full/js/input/tex/AllPackages could not be found within the project.

@ShaMan123 yes i have npx globally,

just to be clear, i ran npm run compile inside node-modules/mathjax-full and outputs the same error with npx tsc

...... npx: installed 1 in 1.309s error TS5023: Unknown compiler option 'downlevelIteration'. error TS5023: Unknown compiler option 'lib'. npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! [email protected] compile: npx tsc ...

@ShaMan123
Copy link
Owner

update typescript version
beyond this I am unable to help

@joaortizro
Copy link

Wow updating typescript does the job, sorry for this lack of debugging i mainly use JS

Thank you ! i will try this on my actual app

finally

@ShaMan123
Copy link
Owner

I just managed to debug on ios and found the problem for the duplicate hook call.
Should be resolved.
bumping version.

@rolaay
Copy link

rolaay commented Feb 6, 2020

Apparently i did have a problem with mathjax-full , i've tried to add it but still same error

Error: ENOENT: no such file or directory, copyfile '/home/kib/Projects/KIB/kibApp/node_modules/mathjax-full/ts/input/tex/mhchem/mhchem_parser.js' -> '/home/kib/Projects/KIB/kibApp/node_modules/mathjax-full/js/input/tex/mhchem/mhchem_parser.js' at Object.copyFileSync (fs.js:1731:3) at Object.<anonymous> (/home/kib/Projects/KIB/kibApp/node_modules/react-native-math-view/scripts/compileMathjax.js:22:4) at Module._compile (internal/modules/cjs/loader.js:774:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:785:10) at Module.load (internal/modules/cjs/loader.js:641:32) at Function.Module._load (internal/modules/cjs/loader.js:556:12) at Function.Module.runMain (internal/modules/cjs/loader.js:837:10) at internal/main/run_main_module.js:17:11 { errno: -2, syscall: 'copyfile', code: 'ENOENT', path: '/home/kib/Projects/KIB/kibApp/node_modules/mathjax-full/ts/input/tex/mhchem/mhchem_parser.js', dest: '/home/kib/Projects/KIB/kibApp/node_modules/mathjax-full/js/input/tex/mhchem/mhchem_parser.js' }

Please have you been able to resolved this

@rolaay
Copy link

rolaay commented Feb 7, 2020

update typescript version
beyond this I am unable to help

This worked for me. Thank you.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants