Unable to add fcm plugin in ionic 2 app - ionic2

I am trying to add fcm plugin in my project but it shows following error
ionic cordova plugin add cordova-plugin-fcm
> cordova plugin add cordova-plugin-fcm --save
Error: Failed to fetch plugin file:node_modules/cordova-plugin-fcm via registry.
Probably this is either a connection problem, or plugin spec is incorrect.
Check your connection and plugin name/version/URL.
Error: cmd: Command failed with exit code 4294963238 Error output:
npm ERR! addLocal Could not install F:\PROJECTS\IONIC2\foodJunctionMobileApp\node_modules\cordova-plugin-fcm
npm ERR! Windows_NT 10.0.16299
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "file:node_modules/cordova-plugin-fcm" "--production" "--save"
npm ERR! node v6.9.5
npm ERR! npm v3.10.10
npm ERR! path F:\PROJECTS\IONIC2\foodJunctionMobileApp\node_modules\cordova-plugin-fcm
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall open
npm ERR! enoent ENOENT: no such file or directory, open 'F:\PROJECTS\IONIC2\foodJunctionMobileApp\node_modules\cordova-plugin-fcm'
npm ERR! enoent ENOENT: no such file or directory, open 'F:\PROJECTS\IONIC2\foodJunctionMobileApp\node_modules\cordova-plugin-fcm'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! Please include the following file with any support request:
npm ERR! F:\PROJECTS\IONIC2\foodJunctionMobileApp\npm-debug.log
here is my
ionic info
cli packages: (C:\Users\Rohit\AppData\Roaming\npm\node_modules)
#ionic/cli-utils : 1.19.0
ionic (Ionic CLI) : 3.19.0
global packages:
cordova (Cordova CLI) : 7.1.0
local packages:
#ionic/app-scripts : 3.1.6
Cordova Platforms : android 6.3.0
Ionic Framework : ionic-angular 3.9.2
System:
Android SDK Tools : 25.2.5
Node : v6.9.5
npm : 3.10.10
OS : Windows 10
Environment Variables:
ANDROID_HOME : C:\Users\Rohit\AppData\Local\Android\sdk
Misc:
backend : pro
I am connected to the internet so that is not the problem. I have added google plus plugin before installing fcm and that time it was conflicting with fcm plugin so I removed google plus plugin and tried to install fcm only but failed.kindly help if anyone knows about it. Thank you.

I use this firebase plugin:
https://www.npmjs.com/package/cordova-plugin-firebase
This is how you can install it :
cordova plugin add cordova-plugin-firebase#0.1.24 --save
It also works with the lates ionic version.

you can follow this tutorial, it explains all the errors that you can get during the process, hope this helps.
https://www.djamware.com/post/58a1378480aca7386754130a/ionic-2-fcm-push-notification

Related

Not able to create a new ember app - Could not resolve dependency error

I'm just trying to create a new app from scratch, but getting this error:
Command failed with exit code 1: npm install --loglevel error
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: ember-sample#0.0.0
npm ERR! Found: ember-cli#4.3.0
npm ERR! node_modules/ember-cli
npm ERR! dev ember-cli#"~4.3.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer ember-cli#"~3.2.0" from ember-cli-dependency-checker#3.3.0
npm ERR! node_modules/ember-cli-dependency-checker
npm ERR! dev ember-cli-dependency-checker#"^3.2.0" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
These are the repro steps:
open command prompt in Win11.
install ember
npm install -g ember-cli
create app ember-sample
ember new ember-sample
and just after that I get the error above.
Could I be missing anything? I have already installed node v16.14.2, npm 8.5.0, ember-cli: 4.3.0
I was already taking a look on ember.js official website
Actually Ember CLI is Compatible with NodeVersion 12. You might be using a later node versio like 14 or 16. My problem is solved when I downgraded to Node 12 lts
A fix is on its way. You could follow what #NullVoxPopuli said in the comments.
https://github.com/quaertym/ember-cli-dependency-checker/issues/132

windows 10 -'bash' is not recognized as an internal or external command, operable program or batch file [duplicate]

i have an error in installing react-flux-starter-kit-windows.
i have installed latest node.js and npm
when i am using this command :
npm install -g react-flux-starter-kit
it gives me following error
react-flux-starter-kit#1.1.4 postinstall C:\Users\Hardik\AppData\Roaming\npm\node_modules\react-flux-starter-kit
bash setup.sh
'bash' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Users\Hardik\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js" "install" "-g" "react-flux-starter-kit"
npm ERR! node v6.9.5
npm ERR! npm v4.2.0
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! react-flux-starter-kit#1.1.4 postinstall: bash setup.sh
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the react-flux-starter-kit#1.1.4 postinstall script 'bash setup.sh'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the react-flux-starter-kit package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! bash setup.sh
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs react-flux-starter-kit
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls react-flux-starter-kit
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\Hardik\AppData\Roaming\npm-cache_logs\2017-02-22T10_01_48_356Z-debug.log
It seems that it needs Bash installed. If you're using Windows then you may be able to install it using one of:
https://git-for-windows.github.io/
https://www.cygwin.com/
https://msdn.microsoft.com/en-us/commandline/wsl/about
http://win-bash.sourceforge.net/
Go with the steps
Setting->update->for developers->developers mood->on->yes.
Control Panel->programs & features->Turn windows features on or off->Windows subsystem for linux->restart computer.
The same error can appear if the bash isn't present in path env, so you need to add it manually.
Add this directory to your path env:
C:\Program Files\Git\bin
I had the same problem and I solved it in 2 stages:
First, I turned on the 'Developer Mode' (Settings -> Update and Security -> For developers).
Second, I installed Ubuntu app from Microsoft Store, then ran Command Prompt as administrator and typed bash and set a username and password.
To fix this on Windows, if you install git for windows you will get git.exe at this directory:
C:\Program Files\Git\cmd
but the file is git.exe and you need bash.exe for Windows.
So use this to create a doskey alias to bash command
doskey bash=git
Now type bash at command line and you should see the help output from git.exe.
If you're using Windows then you may be able to use GIT Bash which you probably already have it installed or get it from https://gitforwindows.org/ instead of using Windows Command Prompt or Windows PowerShell.

Laravel 5.5 API Authentication (Passport) - cross-env: not found error, when i run npm run dev

I have tried to implement laravel passport authentication in my project, but it's not working. Initially, i have installed laravel5.5 with other configuration and file permissions all the stuff.
To implement passport authentication I have followed laravel documentation Document Url
Following steps, I have done,
composer require laravel/passport
php artisan migrate
php artisan passport:install
I have added this line App\User
use Laravel\Passport\HasApiTokens;
use HasApiTokens, Notifiable;
Routes Added in AuthServiceProvider file inside the boot function
Passport::routes();
Inside the config/auth.php file, I have changed API driver as passport
php artisan vendor:publish --tag=passport-components
Inside this file resources/assets/js/app.js
Vue.component(
'passport-clients',
require('./components/passport/Clients.vue')
);
Vue.component(
'passport-authorized-clients',
require('./components/passport/AuthorizedClients.vue')
);
Vue.component(
'passport-personal-access-tokens',
require('./components/passport/PersonalAccessTokens.vue')
);
npm run dev
When running this command I'm getting an error
$ npm run dev
# dev /var/www/html/local/laravel5.5
npm run development
# development /var/www/html/local/laravel5.5
cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js
sh: 1: cross-env: not found
npm ERR! Linux 4.4.0-98-generic
npm ERR! argv "/home/sysadmin/.nvm/versions/node/v6.11.1/bin/node" "/home/sysadmin/.nvm/versions/node/v6.11.1/bin/npm" "run" "development"
npm ERR! node v6.11.1
npm ERR! npm v3.10.10
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! # development: cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the # development script 'cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls
npm ERR! There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?
npm ERR! Please include the following file with any support request:
npm ERR! /var/www/html/local/laravel5.5/npm-debug.log
npm ERR! Linux 4.4.0-98-generic
npm ERR! argv "/home/sysadmin/.nvm/versions/node/v6.11.1/bin/node" "/home/sysadmin/.nvm/versions/node/v6.11.1/bin/npm" "run" "dev"
npm ERR! node v6.11.1
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! # dev: npm run development
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the # dev script 'npm run development'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! npm run development
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls
npm ERR! There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?
npm ERR! Please include the following file with any support request:
npm ERR! /var/www/html/local/laravel5.5/npm-debug.log
You must run in cmd/terminal, from your project folder
npm install --save
and then
npm run dev

Zurb Foundation For Emails gulp --production Fails

I've been using Zurb Foundation for Emails successfully for quite some time. Suddenly the build process is failing.
I updated to Node 7.7.2 and NPM 4.1.2, deleted the node_modules directory and ran npm install to reinstall the dependencies, but it didn't solve the issue.
$ npm run build
foundation-emails-template#1.0.0 build /Users/[REDACTED]
gulp --production
[12:46:56] Requiring external module babel-register
[12:46:57] Using gulpfile ~/[REDACTED]/gulpfile.babel.js
[12:46:57] Starting 'default'...
[12:46:57] Starting 'build'...
[12:46:57] Starting 'clean'...
[12:46:57] Finished 'clean' after 11 ms
[12:46:57] Starting 'pages'...
[12:46:59] Finished 'pages' after 1.32 s
[12:46:59] Starting 'sass'...
[12:47:05] 'sass' errored after 6.91 s
[12:47:05] Error in plugin 'gulp-uncss'
Message:
Unexpected EOF
Details:
domainEmitter: [object Object]
domain: [object Object]
domainThrown: false
[12:47:05] 'build' errored after 8.25 s
[12:47:05] 'default' errored after 8.25 s
npm ERR! Darwin 15.6.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "build"
npm ERR! node v7.7.2
npm ERR! npm v4.1.2
npm ERR! code ELIFECYCLE
npm ERR! foundation-emails-template#1.0.0 build: `gulp --production`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the foundation-emails-template#1.0.0 build script 'gulp --production'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the foundation-emails-template package,
npm ERR! not with npm itself.
Or if I try to run gulp --production by itself:
$ gulp --production
[12:29:38] Requiring external module babel-core/register
[12:29:39] Using gulpfile ~/[REDACTED]/gulpfile.babel.js
/usr/local/lib/node_modules/gulp/bin/gulp.js:129
gulpInst.start.apply(gulpInst, toRun);
^
TypeError: Cannot read property 'apply' of undefined
at /usr/local/lib/node_modules/gulp/bin/gulp.js:129:19
at _combinedTickCallback (internal/process/next_tick.js:73:7)
at process._tickDomainCallback (internal/process/next_tick.js:128:9)
npm start works as expected; I just can't inline the styles.
Any ideas? TIA.
It's because the node environment had changed.
Run this in your console:
npm rebuild node-sass
npm rebuild gulp-uncss
It should fix the issue.
I got the same error and was caused by a code-specific issue so make sure all your code is valid. In my case I was missing a closing " on a class.

ember-cli 0.0.40 version installation

npm install ember-cli#0.0.40
returns E404. I know that it is too old version, but i should work any way. Should I install anything else? (0.0.44 works fine)
Any solution?
here is full output :
npm ERR! Windows_NT 6.3.9600 npm ERR! argv "C:\Program
Files\nodejs\node.exe" "C:\Program Files\nodejs\
node_modules\npm\bin\npm-cli.js" "install" "ember-cli#0.0.40" npm
ERR! node v4.3.1 npm ERR! npm v2.14.12 npm ERR! code E404
npm ERR! 404 Registry returned 404 for GET on
https://registry.npmjs.org/express s npm ERR! 404 npm ERR! 404
'expresss' is not in the npm registry. npm ERR! 404 You should bug the
author to publish it (or use the name yourself!)
npm ERR! 404 It was specified as a dependency of 'ember-cli' npm ERR!
404 npm ERR! 404 Note that you can also install from a npm ERR! 404
tarball, folder, http url, or git url.
npm ERR! Please include the following file with any support request:
npm ERR! C:\Windows\system32\npm-debug.log
here is npm version output:
{ npm: '2.14.12', ares: '1.10.1-DEV', http_parser: '2.5.2', icu:
'56.1', modules: '46', node: '4.3.1', openssl: '1.0.2f', uv:
'1.8.0', v8: '4.5.103.35', zlib: '1.2.8' }
You can download the package from the bottom of this page https://github.com/ember-cli/ember-cli/releases/tag/v0.0.40
Then you look up npm documentation on how to install from a file.