Error: Cannot find module 'nativescript-zxing' - import

I want to use ZXing in my NativeScript Angular app. I installed the plugin and I´m able to find it in my node_modules folder. But as I try to import the plugin, it says: "Cannot find module 'nativescript-zxing'
I tried reinstalling it, but the issue came back. I can't seem to find any related posts to that topic, as I´m not sure where the problem can be.
This is my import command:
import { ZXing } from 'nativescript-zxing'
I hope someone can help me out, or push me on the right track.

Remove node_modules folder using rm -rf node_modules/
add "nativescript-zxing": "^1.5.8" in your package.json file
npm install
Run the tns run ios
if running on Android, firstly run rm -rf node_modules/nativescript-zxing/platforms/android and than tns run android

Related

How do I fix an error: Unknown plugin "flow-react-proptypes" in react native?

I'm trying to use https://github.com/jacklam718/react-native-action-sheet-component in a react-native project and am getting the following runtime error
Unknown plugin "flow-react-proptypes" specified in
"node_modules/react-native-action-sheet-component/.babelrc.env.development
I tried yarn add babel-plugin-flow-react-proptypes -D but that didn't seem to fix it.
React-native version 0.41.2, iOS
Im not familiar with yarn but from that repo packaje.json we can see that babel-plugin-flow-react-proptypes is listed as devDependency so it won't get installed when installing the package from npm.
Try installing it in your node_modules folder (if that's not what you already did with yarn) or go into node_modules/react-native... And execute npm install.

Missing Module in gulpfile 'clone-stats'

I am working with ionic and my ionic build android command isn't working.
The error message I get is "Uh oh! Looks like you're missing a module in your gulp file: Cannot find module 'clone-stats'
Do you need to run 'npm install'?
I highlighted my steps in the image below:
I have no idea what 'clone-stats' is and why it is missing. It was working yesterday.
I have tried to reinstall ionic. I tried npm install -g. I tried removing and adding the android platform back. ionic serve gives me the same error.
I am not familiar with gulp. Does anybody know the problem?
Thanks.
You have required to install 'clone-stats' module.
open terminal
go to your project folder and type npm install clone-stats.
if you facing permission error then use sudo npm install clone-stats
hope it's work for you..

Ember-CLI error on changing a CSS file

I'm trying out Ember-CLI, and have encountered my first obscure problem (there were others, but… they're fixed). On trying to save a change in the app.css file, this happens:
file changed styles/app.css
EEXIST, file already exists '/Users/admin/projects/saves/tmp/caching-writer-dest-dir_fjlhTg.tmp'
Error: EEXIST, file already exists '/Users/admin/projects/saves/tmp/caching-writer-dest-dir_fjlhTg.tmp'
at Error (native)
at Object.fs.symlinkSync (fs.js:852:18)
at symlink (/Users/admin/projects/saves/node_modules/ember-cli/node_modules/symlink-or-copy/index.js:82:14)
at Function.symlinkOrCopySync (/Users/admin/projects/saves/node_modules/ember-cli/node_modules/symlink-or-copy/index.js:58:5)
at /Users/admin/projects/saves/node_modules/ember-cli/node_modules/broccoli-sourcemap-concat/node_modules/broccoli-caching-writer/index.js:103:21
at lib$rsvp$$internal$$tryCatch (/Users/admin/projects/saves/node_modules/ember-cli/node_modules/promise-map-series/node_modules/rsvp/dist/rsvp.js:489:16)
at lib$rsvp$$internal$$invokeCallback (/Users/admin/projects/saves/node_modules/ember-cli/node_modules/promise-map-series/node_modules/rsvp/dist/rsvp.js:501:17)
at lib$rsvp$$internal$$publish (/Users/admin/projects/saves/node_modules/ember-cli/node_modules/promise-map-series/node_modules/rsvp/dist/rsvp.js:472:11)
at lib$rsvp$asap$$flush (/Users/admin/projects/saves/node_modules/ember-cli/node_modules/promise-map-series/node_modules/rsvp/dist/rsvp.js:1290:9)
at process._tickCallback (node.js:355:11)
The closest match I can find is this ember-cli issue.
Update and fix:
I tried the following:
rm -rf node_modules tmp dist && npm cache clean
ember install
But the issue persisted (after also trying the add rimraf to dependencies and doing npm install rimraf, now removed again).
The actual solution
Then it occurred to me that I needed to npm update ember-cli, then the above commands again, after which all is working now :-)
Update: As per raytiley's comments, the issue is not with rimraf, and the offender (broccoli-caching-writer) should be fixed soon. Therefore, at this time, Step 1 should not be necessary if you're experiencing this problem now.
See the comments in the Github Issue
This looks like a recent issue with dependencies, specifically rimraf. Currently, users are having success with this solution:
First, add this to your package.json file: (Not needed anymore)
"dependencies": {
"rimraf": "2.2.8"
}
Secondly, type this into the command line to re-install your node items
rm -rf node_modules tmp dist && npm cache clean
ember install
Hope that helps!

Ionic framework - 'ionic' is not recognized as an internal or external command

I was trying to install ionic and create a sample project on it since morning. But, was facing a series of issues since then. Tried solving them one by one. Atlast restarted my machine and opened command prompt to build the sample project and tried
path of the sample project> ionic build android
But, i kept on facing the error that states 'ionic' is not recognized as an internal or external command.
I tried clearing the cache and reinstalling ionic in my machine. Still, I face the same issue of ionic is not recognized as an internal or external command.
Can somebody help me out on this issue?
Thanks
Manikandan J
Somehow , my npm path was not there in PATH environmental Variable
So after adding C:\Users\XXXXX\AppData\Roaming\npm to my PATH variable my problem solved :-)
Try to install the ionic framework with the -g parameter, so the installation will be globall, like this:
npm install -g ionic
-g parameter mean "its binaries end up in your PATH environment variable."
If you're on Windows 10 (and possibly Vista/8/8.1) you need to run cmd.exe as an administrator. Now when you run the commands below, your environment settings will be made.
npm install -g cordova ionic
Check if the configuration is broken or not. the update might have installed it in the wrong place.
First check: npm config get prefix
In my case It wasn't set to /usr/local but in /usr/Roaming.
So to fix it, use: npm config set prefix
Problem solved! :)
After several hours of struggle I fixed it by the below steps:
uninstall node js restart the system .
install the node js (current version).
check your node js path in System variable in an
environmental variable.
Right click the command prompt and select run as administrator. Type cd\ now get into the npm path folder by cd <YourNpmPath>\npm install -g ionic#4
That's it . Now it is globally available throughout the system.
I ran this command to uninstall:
npm uninstall -g ionic cordova
and then ran the install:
npm install -g ionic cordova
and then everything started working again.
Insert this into your system path. This happens because node modules are not seen but when you do this you make the path to the module. They are found in this location
C:\Users\[username]\AppData\Roaming\npm
Below simple steps to follow to get it working:
install Node.js
Install Ionic and cordova : npm install -g cordova ionic
create a simple project: ionic start mySimpleApp tabs
cd mySimpleApp
ionic cordova platform add android
Build the project: ionic build android
For the benefit of searchers, the other answers didn't work for me.
I deleted the 'Ionic' folder from:
C:\Users\..{me}..\AppData\Roaming\npm\node_modules
Then installed again with:
npm install -g ionic cordova
That fixed it.
I solve the problem on windows 10.The problem was that the environment variables don't contain a path to the ionic folder.
Just do:
npm config set prefix
And then
npm install -g ionic cordova
setting the path variable to C:\Users\«user name folder»\appdata\Roaming\npm helped me to resolve the issue. Please try
uninstall the old version
npm uninstall -g ionic
and try to install it again with the new version
npm install -g #ionic/cli
In my situation, I thought Ionic did not install,
but after I had changed my Windows User-Name, npm did for some reason still install on the last %AppData% folder path.
for example correct-path for new user-name is:
C:\Users\Admin\AppData\Roaming\npm
but npm did use:
C:\Users\Abc\AppData\Roaming\npm
have moved that folder contents to the right place and all just works!
But to finally fix the issue from its root cause I updated NPM settings like:
npm config -g set prefix "%AppData%\npm"
npm config -g set cache "%AppData%\npm-cache"
npm config -g get prefix
And ensured my PATH environment-variable includes the correct NPM directory.
This issue occurs when we change the path variables manually.Because of this change system doesn't find libraries for the command which needed to be executed.
While installing ionic cordova, ionic cli takes cares by adding path variable in your environment.Hope this content helps
path -
C:\user\system_name\AppData\Roaming\npm
I had the same problem on Windows, and I find solution by navigating the command prompt to
C:\Users\[username]\AppData\Roaming\npm>
Cordova, Ionic, etc. are found here.
The following steps worked for me in 2022:
Run the command prompt as Admin. This is mandatory to ensure that ionic is installed globally, otherwise you would continue to see the same error message despite installing ionic.
Type this command and hit enter: npm i -g #ionic/cli
That's it!
'ionic/java/cordova etc..' is not recognized as an internal or external command
for ionic or cordova install it from node using npm install -g ionic/cordova command.
This kind of messages comes whenever its PATH not set properly for other programs like java. System has to recognize your command available on your system or not. This can be identified only when you set your environment variable.
use this for setting your path
SET PATH = %PATH%; your app path to bin
Just follow this video, you have to set your path correctly.
http://learn.ionicframework.com/videos/windows-android/
1: Download and Install Java then open your system environment variables, and add to or create a new user variable called PATH with the full path to the bin folder of the new Java SDK installation.
2: Download Apache Ant then add the full path to the bin/ folder to the end of your PATH environment variable.
3: Add Android to PATH :Open up your environment variables setting and add the full path to both the adt-bundle/sdk/platform-tools/ folder and the adt-bundle/sdk/tools/ folder to the end of your PATH variable:
4.Install nodeJs and now you can do
npm install -g cordova ionic
I started getting this same error in the Console2 command prompt. I checked the environment variables and reinstalled ionic and cordova but this did not fixed it.
I then tried ionic in Node.js command prompt and it worked perfectly. So if you follow the other advice and it still doesn't work, try a different command prompt.
I think you should copy the bin file to the system variables and it should be fine, at least I try it on Win7 and it worked. I also got the same prob like this before.
Right click Computer, choose Properties, Advanced system settings and edit environment variables.
Try reinstalling the ionic
npm install ionic -g
uninstall ionic npm package and then clear all npm cache in appdata and then install ionic
npm install -g ionic
ionic info
you must install ionic package has global so use -g.
ionic info command is used to check the ionic information
Well, after trying several answers from many posts like this one and realizing that my environment variables were there too, I ran the
npm install -g cordova ionic
from the inside of nodejs folder in Program Files with windows prompt as administrator.
Initially I was installing it in my dev folder in D:\ partition. Hope it helps someone.
Probably you doesn't have ionic installed in your device.
First check in terminal/cmd, have you installed ionic or not?
you can check it with following command:
ionic -v
C:\Program Files\nodejs\bin
try adding this to your user and environment variables, under environment variables, and then close the command prompt window and open.
I got my problem resolved :)
npm install -g cordova ionic
and then
ionic start myApp tabs
and then
cd myApp
ionic serve
Firstly uninstall the ionic module from the project by using the following command.
npm uninstall -g ionic cordova
Then install ionic and cordova dependencies seperately as follows.
npm install -g ionic
npm install -g cordova
Please check whether ionic cli is installed or not globally and locally both
Node versions
Check if you are using the nvm,
you would have installed the ionc cli with node version 14.X, and now you might be using node 16.X or latest, this is why the ionic cli is not working in latest node version.
check list of node versions if by using nvm:
nvm list
try changing the node version to previous,
NVM user older node
change to older nvm:
nvm use 14.x.x
or your version in list

unable to grab wrapper project: undefined in start project ionic

I Got this error "unable to grab wrapper project: undefined" in start project ionic, when I tried to create a new project in ionic framework, can anyboby help me ?
This works:
PROXY=http://myproxy.com:8081 ionic start myApp
If you have a username and password
PROXY=http://username:password#myproxy.com:8081 ionic start what
You are having problem with ionic installation.
Go thoroughly through this doc:
Install cordova if you haven't
npm install -g cordova
Install ionic
npm install -g ionic
Notice any permission related issues while installing. Make sure there were no issues (Errors generally has tag ERR)
Good luck!
For anyone else that comes across this issue the following website helped me out - http://www.jasonwatmore.com/post/2014/04/02/Ionic-Framework-Getting-ionic-start-appName-Working-Behind-a-Proxy.aspx
The error was being caused by proxy issues. As it looks like Ionic doesn't pick up the proxy from either node or git. So I followed the instructions (Step 1) on the link and that resolved my initial error.
I also had to additionally install Plugman on top of Cordova:
npm install -g plugman
And then also add the proxy setting to plugman:
plugman config set proxy http://yourproxy.com