ionic 2 sample conference app can't find babelify module - npm

I am learning ionic2. I thought the sample app was a good starting point but unfortunately, I can't get it work. It complained about missing module.Please see the output:
lola#ubuntu:~/pj/ionic-conference-app$ ionic serve
Running 'serve:before' gulp task before serve
[08:53:57] Starting 'sass'...
[08:53:57] Starting 'html'...
[08:53:57] Starting 'fonts'...
[08:53:57] Starting 'scripts'...
[08:53:57] Finished 'scripts' after 63 ms
[08:53:57] Finished 'html' after 115 ms
[08:53:57] Finished 'fonts' after 114 ms
[08:53:58] Finished 'sass' after 888 ms
[08:53:58] Starting 'watch'...
✗ Caught exception:
Error: Cannot find module 'babelify' from '/home/lola/pj/ionic-conference-app'
at /home/lola/pj/ionic-conference-app/node_modules/ionic-gulp-browserify-es2015/node_modules/browserify/node_modules/resolve/lib/async.js:46:17
at process (/home/lola/pj/ionic-conference-app/node_modules/ionic-gulp-browserify-es2015/node_modules/browserify/node_modules/resolve/lib/async.js:173:43)
at ondir (/home/lola/pj/ionic-conference-app/node_modules/ionic-gulp-browserify-es2015/node_modules/browserify/node_modules/resolve/lib/async.js:188:17)
at load (/home/lola/pj/ionic-conference-app/node_modules/ionic-gulp-browserify-es2015/node_modules/browserify/node_modules/resolve/lib/async.js:69:43)
at onex (/home/lola/pj/ionic-conference-app/node_modules/ionic-gulp-browserify-es2015/node_modules/browserify/node_modules/resolve/lib/async.js:92:31)
at /home/lola/pj/ionic-conference-app/node_modules/ionic-gulp-browserify-es2015/node_modules/browserify/node_modules/resolve/lib/async.js:22:47
at FSReqWrap.oncomplete (fs.js:82:15)
Mind letting us know? https://github.com/driftyco/ionic-cli/issues
$ionic info
Your system information:
Cordova CLI: 6.1.1
Ionic Version: 2.0.0-beta.3
Ionic CLI Version: 2.0.0-beta.22
Ionic App Lib Version: 2.0.0-beta.12
OS:
Node Version: v4.4.2
Can anyone help me?

More than likely, you need to update NPM which will include the babelify dependencies. Check your version of NPM by running npm -v , it should be v3.x. Run sudo npm install -g npm to update npm. and you should be good to go.

Just npm install in project root worked for me.

Related

Expo SDK 44 upgrade error - "expo-cli upgrade"

I want to upgrade expo to the latest version - SDK 47 from SDK 44 that I am currently using.
My npm version is 8.19.2, node version is 16.18.2 if it helps.
When I tried running the command: expo-cli upgrade, I am getting the following error:
✖ Failed to install expo package with error: npm exited with non-zero code: 1
npm exited with non-zero code: 1
Error: npm exited with non-zero code: 1
at ChildProcess.completionListener (/Users/abcd/.nvm/versions/node/v16.18.0/lib/node_modules/expo-cli/node_modules/#expo/spawn-async/src/spawnAsync.ts:65:13)
at Object.onceWrapper (node:events:628:26)
at ChildProcess.emit (node:events:513:28)
at maybeClose (node:internal/child_process:1100:16)
at Process.ChildProcess._handle.onexit (node:internal/child_process:304:5)
...
at spawnAsync (/Users/abcd/.nvm/versions/node/v16.18.0/lib/node_modules/expo-cli/node_modules/#expo/spawn-async/src/spawnAsync.ts:26:19)
at NpmPackageManager._runAsync (/Users/abcd/.nvm/versions/node/v16.18.0/lib/node_modules/expo-cli/node_modules/#expo/package-manager/src/NodePackageManagers.ts:166:31)
at NpmPackageManager.installAsync (/Users/abcd/.nvm/versions/node/v16.18.0/lib/node_modules/expo-cli/node_modules/#expo/package-manager/src/NodePackageManagers.ts:82:16)
at NpmPackageManager.addWithParametersAsync (/Users/abcd/.nvm/versions/node/v16.18.0/lib/node_modules/expo-cli/node_modules/#expo/package-manager/src/NodePackageManagers.ts:96:18)
at NpmPackageManager.addAsync (/Users/abcd/.nvm/versions/node/v16.18.0/lib/node_modules/expo-cli/node_modules/#expo/package-manager/src/NodePackageManagers.ts:109:5)
at upgradeAsync (/Users/abcd/.nvm/versions/node/v16.18.0/lib/node_modules/expo-cli/src/commands/info/upgradeAsync.ts:496:7)
at actionAsync (/Users/abcd/.nvm/versions/node/v16.18.0/lib/node_modules/expo-cli/src/commands/info/upgradeAsync.ts:42:3)
After reading a bit on the internet, I tried deleting the "package.lock.json" file but I have no idea why it would have worked as it didn't.
I also checked "babel-preset-expo", which is set to 9.0.2 as it should be as per another article.
It will be great if anyone here could help me with this issue. Thanks!
I had the same issue with node v16.4.0 while upgrading from SDK 44. Changing to v14.17.6 or v19.1.0 made the "expo upgrade" command work properly. These are examples, I am sure it works with other versions, just test by yourself.
You can find node versions on this link : https://nodejs.org/dist/index.json
If you do not want to change your node version for some reason, I do not have a solution for it then. I am currently in this case and searching for a solution ...

npm run serve or bulid fails on linux, but fine on Windows

Has anyone seen this error that has just started happening on my linux box? npm run serve and npm run build both run fine on my Windows machine as usual, but, as of yesterday, I get the following error on the linux box.
The code is the same (pulled from the git repo) and npm install is run before npm run serve or npm run build
Any ideas how I can track this down?...
root#agilesimulations:/usr/apps/socket-test# npm run serve
> socket-test#0.1.0 serve
> vue-cli-service serve --port 8098
INFO Starting development server...
98% after emitting CopyPlugin
ERROR Failed to compile with 1 error 3:38:16 PM
error in ./src/main.js
Syntax Error: Error: Cannot find module '#eslint/eslintrc'
# multi (webpack)-dev-server/client?http://localhost:8098&sockPath=/sockjs-node (webpack)/hot/dev-server.js ./src/main.js

Getting error when installing Bugsnag 'Error: spawn npm ENOENT'

this is the first time I post here so apologies if I don't follow some rules or incorrect formatting.
I'm making an app using React Native and Expo and when I try to install bugsnag I get this error.
$ npx bugsnag-expo-cli init
√ #bugsnag/expo does not appear to be installed, do you want to install it? ... yes
√ If you want the latest version of #bugsnag/expo hit enter, otherwise type the version you want ... latest
√ Using yarn or npm? » npm
> Installing #bugsnag/expo with npm. This could take a while!
Error: spawn npm ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:269:19)
at onErrorNT (internal/child_process.js:465:16)
at processTicksAndRejections (internal/process/task_queues.js:80:21)
Are you attempting to run the bugsnag-expo-cli on Windows? The Expo CLI currently only supports MacOS and Linux:
https://docs.bugsnag.com/platforms/react-native/expo/#installation-and-configuration
As an alternative to the CLI, you can follow the manual integration guide:
https://docs.bugsnag.com/platforms/react-native/expo/manual-setup/

Failed to start the app. Run CLI with --verbose flag for more details

Error: Command failed: adb shell am start -n com.getgroceryapp/com.getgroceryapp.MainActivity
at makeError (F:\desuvit\projects\workingbranch\MobileApp\node_modules\execa\index.js:174:9)
node version: 12.4.0
npm version: 6.14.7
Using these command for running the app: 1)react-native run-android or npx react-native run-android
also same error
after i upgraded to v12.18.3(node version) also same error.
but i'm trying to run the project getting above error
please help me
advance thanks....
Open Android Studio File -> Project Structure -> Gradle Settings -> Gradle JDK
and set up as
Embedded JDK
This worked for me after trying so many other options.
If you previously installed a global react-native-cli package, please remove it as it may cause unexpected issues:
npm uninstall -g react-native-cli #react-native-community/cli

Cannot start ReactNativeProject

I followed the tutorial in the link here https://facebook.github.io/react-native/docs/getting-started.html#content . As it turns out, npm 5 is not supported yet. I tried installing npm 4 but, it is not working either. Stuck in the first page of the tutorial, when I run npm start, I am getting a bunch of errors too. Literally stuck, nowhere else to turn. Before voting down the question, kindly note that I am a mobile developer working with andorid and Ios having no previous knowledge about web technologies. Thanks
These are the steps I followed
npm install -g create-react-native-app
It was successfull, then,
create-react-native-app AwesomeProject
for this line, I got the following error
*******************************************************************************
ERROR: npm 5 is not supported yet
*******************************************************************************
It looks like you're using npm 5 which was recently released.
Create React Native App doesn't work with npm 5 yet, unfortunately. We
recommend using npm 4 or yarn until some bugs are resolved.
You can follow the known issues with npm 5 at:
https://github.com/npm/npm/issues/16991
*******************************************************************************
Then I ran the command
cd AwesomeProject
Afterwards I ran
npm start
for which I got the error
npm ERR! missing script: start
npm ERR! A complete log of this run can be found in:
npm ERR! /home/jayakrishnan/.npm/_logs/2017-07-25T08_13_06_277Z-debug.log
I tried using Yarn But didnt work
npm i -g npm#4.6.1 - then install create-react-native-app again and create a project.
Solution with Yarn:
First install Yarn
yarn global add create-react-native-app
cd AwesomeProject
yarn start
npm install -g npm#4 Use this to downgrade, Also use sudo with the commands, sometime it does give permission to write error and skips the installation
Try putting more information about the error so we can help, or steps to reproduce it.
One thing to try is to instead of using npm, use yarn. Install yarn with brew install yarn if you are on mac and do the same steps in the getting-started guide, except for use yarn run ios to start app in ios simulator.
I just tried with a fresh setup that this is working perfectly fine.
Reference to yarn https://yarnpkg.com/en/