getting error while building in production mode angular5 - angular5

When I run command ng build --prod.I am getting the error as: could not resolve #angular/flex-layout relative to path_to_node_modules/angular5-time-picker/src/material-time-control.module.d.ts

I've just had the problem it was due to using ^2.0.0-beta.10 and the incorrectly published RC version being seen as the higher/newer version. So make sure you are not using ^ the latest version is 2.0.0-beta.10-4905443 so you should use npm install #angular/flex-layout#2.0.0-beta.10-4905443 --save.
To be clear your package.json should not be...
"#angular/flex-layout": "^2.0.0-beta.10-4905443",
this will actually install version 2.0.0-rc.1, which was meant to be released as 2.0.0-beta.6 so it is actually older than >= 2.0.0-beta.7 <= 2.0.0-beta.10-4905443.
Until that is fixed, you should use fixed versioning...
"#angular/flex-layout": "2.0.0-beta.10-4905443",

Related

Warning: Invalid version react-native#0.64.2 for expo sdkVersion 43.0.0. Use react-native#0.64.3

I am working on an expo project and everything is working fine, but I began to get a warning message when android is building as
Warning: Invalid version react-native#0.64.2 for expo sdkVersion 43.0.0. Use react-native#0.64.3
The app is still running fine but I don't how to fix this error yet and I want to know if it won't cause an issue later.
I have tried to run npx react-native upgrade 0.64.3 but it didn't work, I got this error
info Fetching diff between v0.64.2 and v0.64.3... error Fetch request
failed with status 404: 404: Not Found. error Failed to fetch diff for
react-native#0.64.3. Maybe it's not released yet?
changing the version of react-native manually in the package.json and run expo install worked for me
I use the expo doctor command it allows diagnose issues with the project.
I would recommend using the expo upgrade command. It upgrades the project packages and config for the given SDK version.
More to find here.
I just faced the same issue. Basically it's telling you should use a higher version of your react-native. I solved it just by updating it to the specified version.
npx react-native upgrade 0.64.3
More info here.
Cheers,
If as in my case one need a specific version of react-native, let's say older because some legacy dependencies in a particular project that for some reason can't be upgrade, then change the version in the package.json won't work.
What worked as the cli suggested is to use:
expo doctor --fix-dependencies
That installed the correct lower version of react-native
To find out actual problems run this command :
expo doctor
To solve all problems regarding package conflicts run this command:
expo doctor --fix-dependencies
Use sudo on Unix based OS if you have permission issue to run those commands.
To solve the error, I used the below command:
npm install react-native-clean-project --save-dev
It is a library that allows us to resolve conflicts.
This library is added to your dependencies.
This handles the problem and if it is not the case add this command:
react-native clean-project-auto

React Native Fails To Start Server With Error In #react-native-community/cli/build/commands/doctor/healthchecks/index.js

I just created a brand new React Native project, and I can't get it to run. The server always fails on the following:
node_modules/react-native/node_modules/#react-native-community/cli/build/commands/doctor/healthchecks/index.js:48
} catch {}
^
SyntaxError: Unexpected token {
The only thing I've found on this issue is this thread, which ends with people saying to post this question on Stackoverflow, hence why I'm here. I've tried the usual: upgrading node versions, removing node_modules and reinstalling, restarting my machine, all to no avail. I even delved into the code to see if I could figure out what's going on, but nothing jumped out at me.
My hope is that others have run into this with new React Native projects and that someone can help me resolve it. Any suggestions are welcome. Thanks!
Sigh.... Well after struggling with this for a day I found the workaround was to run npx react-native start in one console and then run npx react-native run-ios in another. I was just trying to do the latter by itself (which always worked in the past), and I guess that doesn't work anymore.
Probably your node and/or npm version is to old. Check by npm -v and node -v and update to latest version, or suggesting by react-native crew in dependencies from node site. Or if you use nvm try:
nvm install 16.14.0 && nvm alias default 16.14.0 && nvm use 16.14.0
Note that, this is for specific version. For latest, type:
nvm install --lts --latest-npm
nvm use x.x.x //latest installed version
This problem is due to node version. Upgrade your node verion above 12. It will solve the problem.
Use can either use nvm or directly install the node
if you are using android studio start it with command line
like this cd /path/to/android-studio/bin
then studio.sh make sure its executable

React Native - Dependencies are not compatible with currently expo package version when running npm start

I recently update npm and now, when I run npm start, This message shows up:
Some of your project's dependencies are not compatible with currently installed expo package version:
- #react-native-community/netinfo - expected version range: 5.5.1 - actual version installed: ^5.8.1
Does anyone know how can I remove this Warning ?
Thank you!
I was pulling my hair for a similar problem with firebase...
If the expected version was higher than the installed one it would be fixed easily by running "npm install" but not this one, where the expected version is lower than the Installed one.
The fix is to run "expo update" on the project folder.
or yarn upgrade
You can also use the following:
expo install #react-native-community/netinfo#5.8.1
to fix the problem instead of using the big hammer "expo update" :)
To fix similar issue I ran
expo doctor --fix-dependencies

Vue.js 2.3.2 version mismatch

After running npm run watch in terminal on my php laravel project I got this error:
Module build failed: Error:
Vue packages version mismatch:
- vue#2.3.2
- vue-template-compiler#2.2.6
This may cause things to work incorrectly. Make sure to use the same version for both.
If you are using vue-loader#>=10.0, simply update vue-template-compiler.
If you are using vue-loader#<10.0 or vueify, re-installing vue-loader/vueify should bump vue-template-compiler to the latest.
I tried to run this command npm update vue-template-compiler but the error remained.
Did somebody else meet with this problem?
I found the soluiton, I had to delete the node_modules folder, after I had to run npm install then the problem is solved.

avoid unstable releases of mongoose in npm / package.json

How can I avoid installing unstable releases of mongoose with npm?
After running npm update, I get the following warning in my node app:
# !!! MONGOOSE WARNING !!!
#
# This is an UNSTABLE release of Mongoose.
# Unstable releases are available for preview/testing only.
# DO NOT run this in production.
In my package.json file I have the following entry:
"mongoose": "^3.8.8"
Mongoose is not following standard npm practices and so their unstable builds get recognized as stable by npm. Basically they released 3.9 as an unstable version, this is what causes the warning.
My advise is that you don't trust them anymore to follow such conventions and just lock the version in your package.json:
"mongoose": "3.8"
Check out this answer: How do I update each dependency in package.json to the latest version?
The advice is that if you specify "*" as the version then you will always be updating to the latest stable version.
In your case, I'd recommend uninstalling the mongoose package first and then reinstalling mongoose.
The code:
npm uninstall mongoose
(change "mongoose":"^3.8.8" to "mongoose":"3.8")
npm install
You probably never installed 3.8.8 in the first place (which should be stable) but a 3.9.x version.
Actually, with the ^ you will also install 3.9.x when having ^3.8.8 in the package.json.
In your case, you can either fix the 3.8.8 (or 3.8.18 which is stable as of today, as described in other answer here, by removing the ^) or use th ~ character, which will only match new version on the lowermost version part.
So the following will match (with x being latest available):
* => x.x
^3.8.8 => 3.x
~3.8.8 => 3.8.x
3.8.8 => 3.8.8
Since 3.9 is considered unstable, but ^ will go to 3.9, that is the problem.
Good explanation on version is also found here: https://stackoverflow.com/a/22345808/586754
and use
npm view mongoose versions
to see what versions are available, e. g. what is latest in 3.8 on when 4 is out.
With ~3.8 it will always stay latest in 3.8 (on update), but you will need to update it manually once 4.0 is out.
Also: you can edit the package.json directly and then run
npm update
without having to uninstall/reinstall.