I'm trying to view the UIExplorer on Xcode. I have followed the example and it should be simple. It says to clone react-native, cd to directory, npm install and run npm start. However when I run npm start I get the following error:
react-native#0.8.0 start /Users/chiMarvine/Projects/react-native
./packager/packager.sh || true
/Users/chiMarvine/Projects/react-native/packager/packager.js:233
const dumpName = '/tmp/dump_' + Date.now() + '.json';
^^^^^
SyntaxError: Use of const in strict mode.
at exports.runInThisContext (vm.js:73:16)
at Module._compile (module.js:443:25)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Function.Module.runMain (module.js:501:10)
at startup (node.js:129:16)
at node.js:814:3
I have no idea on how to go about this issue, the build succeeds but the simulator says the following:
Ensure the following:
-Node server is running and available on the same network - run
'npm start' from react-native root
- Node server URL is correctly set in AppDelegate
URL: http://localhost:8081?examples/UIExplorer/UIExplorerApp.ios.bundle?platform=ios&dev=true
The request has timed out
Some help would be great, thanks!
I had the same issue. My problem was that I installed node 4.2.2 with nvm but did not set it to be the default version. The shell that was running the build process had my default node.js running which was very old. To fix it, I ran:
nvm alias default 4.2.2
I have the same problem a moment ago, and my solution is update the NodeJS version to V4.0.0 , after completing, delete the react-native folder, do the original step again.
git clone https://github.com/facebook/react-native.git
cd react-native && npm install
npm start
it is working, hope this could help you.
const is ECMA6 (ES6) javascript syntax. If you have an older version of node without ES6 support you would get this error. Node 4.X versions have ES6 support. Hence upgrading solves the problem.
Related
Error info
requiring unknown module "519", if you are sure the module exists, try
restarting Metro. You may also want to run 'yarn' or 'npm install'
I just add ant-design in my rn program and run pod install and restart android app.
No error in my iOS Application, but wrong with Android application.
What can I do to fix that?
Have you tried with npm install? Usually the error means that you don't have installed a plugin or that you are importing something in the wrong mode.
I have the Node.js version 10.13.0 and i have installed the ifxnjs and when tried to connect to the informix database i am getting the below error. i have to run my test cases using the node version 10 because the dev code is running on that version and i have to run my test cases against the dev code. Can anyone help me in resolving the below error? Does ifxnjs supports the node version 10.13.0.? Any help is appreciated.
Error: The module '\\?\C:\Project\node_modules\ifxnjs\build\Release\ifx_njs_bind.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 57. This version of Node.js requires
NODE_MODULE_VERSION 64. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).
at Object.Module._extensions..node (internal/modules/cjs/loader.js:717:18)
at Module.load (internal/modules/cjs/loader.js:598:32)
at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
at Function.Module._load (internal/modules/cjs/loader.js:529:3)
at Module.require (internal/modules/cjs/loader.js:636:17)
at require (internal/modules/cjs/helpers.js:20:18)
at bindings (C:\Project\node_modules\bindings\bindings.js:81:44)
at Object.<anonymous> (C:\Project\node_modules\ifxnjs\lib\odbc.js:33:31)
at Module._compile (internal/modules/cjs/loader.js:688:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)
We will plan to release this version soon. Look like you are on Windows we will provide priority for that then.
Maybe the problem is that you have upgraded nodejs and you are trying to use a node module compiled with the old version of node in the new version.
Simple solution should be to remove all the packages and install them again
rm -rf node_modules
rm -rf package-lock.json
npm i
If this doesn't fix your problem you can try to rebuild the package. This command download again the sources from internet and rebuild them.
npm rebuild ifxnjs --build-from-source
In some cases I still have the problem and the solution was to manually rebuild the module
cd node_modules/ifxnjs
node-pre-gyp rebuild
This forced the node-pre-gyp tool (the tool used by node to compila binary modules) to take the correct version of node.
These examples works if you use npm, if you are using yarn the command are pretty much the same.
Hope this helps
i am trying to add the ios platform to my project so i can build it in XCode. I ran the following command: ionic cordova platform add ios
this is the error i got:
ionic cordova platform add ios
> cordova platform add ios --save
module.js:544
throw err;
^
Error: Cannot find module 'dezalgo'
at Function.Module._resolveFilename (module.js:542:15)
at Function.Module._load (module.js:472:25)
at Module.require (module.js:585:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/Users/chando/Documents/GIT/testproject/node_modules/cordova-lib/node_modules/npm/lib/utils/correct-mkdir.js:2:15)
at Module._compile (module.js:641:30)
at Object.Module._extensions..js (module.js:652:10)
at Module.load (module.js:560:32)
at tryModuleLoad (module.js:503:12)
at Function.Module._load (module.js:495:3)
[ERROR] Exception:
i have tried multiple variations of deleting node_modules, installing the latest version of ionic, npm etc to no avail.
Has anyone else encountered this?
this is my ionic info:
cli packages: (/usr/local/lib/node_modules)
#ionic/cli-utils : 1.19.0
ionic (Ionic CLI) : 3.19.0
global packages:
cordova (Cordova CLI) : not installed
local packages:
#ionic/app-scripts : 2.1.4
Cordova Platforms : none
Ionic Framework : ionic-angular 3.9.2
System:
Node : v9.2.1
npm : 5.6.0
OS : macOS Sierra
Xcode : Xcode 9.2 Build version 9C40b
Environment Variables:
ANDROID_HOME : not set
Misc:
backend : pro
I had this issue come up after updating to the latest Ionic/Angular for my project this morning. This a work-around, but it worked for me:
Add "dezalgo": "~1.0" to your devDependencies section of package.json
Run npm prune
Run npm install
Build your project
I can't tell you why it works other than to guess that somewhere in all of the NPM modules somebody forgot to include this dependency. I should also note that I updated my global modules as well, but I doubt that that would have had any influence on this.
I'm using Node.js 9.7.0 and npm 5.6.0.
Doing a clean install with rm -rf node_modules && npm install also solves this error.
At the time of writing, the issue is still not fixed. Numerous people are complaining about this dezalgo error on several GitHub issue boards:
nodejs/node #13492
npm/npm #8635
npm/dezalgo #7
tjunnone/npm-check-updates #420
EDIT: this issue seems to appear when one of the dependencies relies on an older npm version (such as david or npm-check-updates packages).
I am using Mac OS Sierra v10.12 and getting error while adding to my Phonegap project within the folder myApp:
$ node -v
v7.2.0
$ npm -v
3.10.9
$ cordova platform add ios
received following errors:
Error during untar for /Users/{user_name}/.cordova/lib/npm_cache/cordova-ios/4.3.0/package.tgz: Error: EACCES: permission denied, open '/Users/{user_name}/.cordova/lib/npm_cache/cordova-ios/4.3.0/package/package.json'
Error: Failed to fetch platform ios
Probably this is either a connection problem, or platform spec is incorrect.
Check your connection and platform name/version/URL.
Error: EACCES: permission denied, open '/Users/{user_name}/.cordova/lib/npm_cache/cordova-ios/4.3.0/package/package.json'
Note: {user_name} is my mac user Id, Can anybody help me!
I think you have to issue with permission to add platform .
Try to following :
$sudo chown -R {user_name} /Users/{user_name}/.cordova/lib/npm_cache/
For more please check here.
Hopes this will help you !
Maybe this is a cache problem of cordova. Delete the cache and try to add the platform again:
rm -rf ~/.cordova
Try upgrading npm, this worked for me:
npm install npm#latest -g
I am currently upgrading to the most recent version of react from 0.11.0 branch.
I have upgraded successfully through each step with minimal issues but when I got to 0.14.0 I hit some issues with:
node_modules/react-native/packager/react-native-xcode.sh
No matter what I do all my machines seem to get this same error.
Command `bundle` unrecognized. Did you mean to run this inside a react-native project?
I also run this same command that script runs from my terminal in the same location and it works fine, I have also set the path as well and before the script runs no mas, set path inside the script still nothing.
I am hoping someone else has saw this and has found a solution or is there a work around so we dont need this script.
I started this project with react-native ~0.6.0 maybe even a little earlier.
I have even removed nvm to combat this issue and using single install of node which is on PATH in both conditions.
Thanks!
Have you installed the latest version of react-native-cli globally?
npm uninstall -g react-native-cli
npm install -g react-native-cli
I personally preferred to install it as a dev dependency.
yarn add -D react-native-cli