How to update React npm package in Visual Studio 2017 - npm

I created a dotnet core 2.0 app using the React+ Redux template in VS2017. The template comes with react v15.6.1 by default, and I would like to upgrade this to v16.
I first tried going into the npm packages folder under the project dependencies list, and right clicking on react > Update Package. The update said it was completed but this however did not actually change my react version.
I then went into the package.json file and started typing in the new version and 16.2.0 came up as an intellisense option, but when I saved the file the package again did not update.
Has anyone figured out how to update the React version that comes with the template, there are a number of improvements in v16 I would like to make use of.

Here we go
After opening VS2017 go to
1) Tools -> NuGet Package Manager -> Package Manager Console
You will see Package Manager Console at the bottom pointing as PM>
2) Go to your root directory of main projects package.json file.
eg.
PM> cd D:\Myproject
3) Once you are in main directory type command below.
PM> ncu -u
After hitting this command, you will get notifications as below.
Using D:\Myproject\package.json
#types/history 4.6.0 → 4.6.2
#types/react 15.0.35 → 16.3.8
#types/react-dom 15.5.1 → 16.0.5
#types/react-hot-loader 3.0.3 → 3.0.6
#types/react-redux 4.4.45 → 5.0.16
#types/react-router 4.0.12 → 4.0.23
#types/react-router-dom 4.0.5 → 4.2.6
#types/react-router-redux 5.0.3 → 5.0.13
#types/webpack 2.2.15 → 4.1.3
#types/webpack-env 1.13.0 → 1.13.5
awesome-typescript-loader 3.2.1 → 5.0.0
bootstrap 3.3.7 → 4.1.0
css-loader 0.28.4 → 0.28.11
event-source-polyfill 0.0.9 → 0.0.12
extract-text-webpack-plugin 2.1.2 → 3.0.2
file-loader 0.11.2 → 1.1.11
history 4.6.3 → 4.7.2
jquery 3.2.1 → 3.3.1
react 15.6.1 → 16.3.1
react-dom 15.6.1 → 16.3.1
react-hot-loader 3.0.0-beta.7 → 4.0.1
react-redux 5.0.5 → 5.0.7
react-router-dom 4.1.1 → 4.2.2
redux 3.7.1 → 3.7.2
style-loader 0.18.2 → 0.20.3
typescript 2.4.1 → 2.8.1
url-loader 0.5.9 → 1.0.1
webpack 2.5.1 → 4.5.0
webpack-hot-middleware 2.18.2 → 2.22.0
webpack-merge 4.1.0 → 4.1.2
aspnet-webpack ^2.0.1 → ^2.0.3
Upgraded D:\Myproject\package.json
If you still getting older versions
Then hit this commands
npm install -g npm-check-updates
ncu -u
Ref

You have to edit package.json and change the version of react, save THEN trigger the update.

Related

Apple Silicon m1 can't importing sklearn

I have been finished install Tensorflow env step by step from "https://developer.apple.com/metal/tensorflow-plugin/"
Tf is working!numpy is working! scipy is working!
but when i import sklearn package, have an error message like this:
ImportError: dlopen(/Users/mecilmeng/miniforge3/envs/tf/lib/python3.9/site-packages/scipy/spatial/qhull.cpython-39-darwin.so, 0x0002): Library not loaded: #rpath/liblapack.3.dylib
Referenced from: /Users/mecilmeng/miniforge3/envs/tf/lib/python3.9/site-packages/scipy/spatial/qhull.cpython-39-darwin.so
Reason: tried: '/Users/mecilmeng/miniforge3/envs/tf/lib/liblapack.3.dylib' (no such file), '/Users/mecilmeng/miniforge3/envs/tf/lib/liblapack.3.dylib' (no such file), '/Users/mecilmeng/miniforge3/envs/tf/lib/python3.9/site-packages/scipy/spatial/../../../../liblapack.3.dylib' (no such file), '/Users/mecilmeng/miniforge3/envs/tf/lib/liblapack.3.dylib' (no such file), '/Users/mecilmeng/miniforge3/envs/tf/lib/liblapack.3.dylib' (no such file), '/Users/mecilmeng/miniforge3/envs/tf/lib/python3.9/site-packages/scipy/spatial/../../../../liblapack.3.dylib' (no such file), '/Users/mecilmeng/miniforge3/envs/tf/bin/../lib/liblapack.3.dylib' (no such file), '/Users/mecilmeng/miniforge3/envs/tf/bin/../lib/liblapack.3.dylib' (no such file), '/usr/local/lib/liblapack.3.dylib' (no such file), '/usr/lib/liblapack.3.dylib' (no such file)
How to fix it?
pip list
Package Version
------------------------ -------------------
absl-py 0.10.0
aiohttp 3.8.1
aiosignal 1.2.0
anyio 3.5.0
appnope 0.1.2
argon2-cffi 20.1.0
astunparse 1.6.3
async-generator 1.10
async-timeout 4.0.1
attrs 21.4.0
Babel 2.9.1
backcall 0.2.0
beniget 0.3.0
bleach 4.1.0
blinker 1.4
Bottleneck 1.3.2
brotlipy 0.7.0
cached-property 1.5.2
cachetools 4.2.2
certifi 2021.10.8
cffi 1.15.0
charset-normalizer 2.0.4
click 8.0.3
cryptography 3.4.7
cycler 0.11.0
Cython 0.29.28
debugpy 1.5.1
decorator 5.1.1
defusedxml 0.7.1
dill 0.3.4
entrypoints 0.3
flatbuffers 2.0
fonttools 4.25.0
frozenlist 1.2.0
gast 0.4.0
google-auth 1.33.0
google-auth-oauthlib 0.4.1
google-pasta 0.2.0
googleapis-common-protos 1.54.0
grpcio 1.42.0
h5py 3.1.0
idna 3.3
importlib-metadata 4.8.2
ipykernel 6.4.1
ipython 7.31.1
ipython-genutils 0.2.0
jedi 0.18.1
Jinja2 3.0.2
joblib 1.1.0
json5 0.9.6
jsonschema 3.2.0
jupyter-client 7.1.2
jupyter-core 4.9.1
jupyter-server 1.13.5
jupyterlab 3.2.1
jupyterlab-pygments 0.1.2
jupyterlab-server 2.10.3
keras 2.8.0
Keras-Preprocessing 1.1.2
kiwisolver 1.3.1
libclang 13.0.0
Markdown 3.3.4
MarkupSafe 2.0.1
matplotlib 3.5.0
matplotlib-inline 0.1.2
mistune 0.8.4
multidict 5.2.0
munkres 1.1.4
nbclassic 0.2.6
nbclient 0.5.3
nbconvert 6.3.0
nbformat 5.1.3
nest-asyncio 1.5.1
networkx 2.6.3
notebook 6.4.6
numexpr 2.8.1
numpy 1.22.2
oauthlib 3.1.1
opencv-python 4.5.5.62
opt-einsum 3.3.0
packaging 21.3
pandas 1.3.5
pandocfilters 1.5.0
parso 0.8.3
pexpect 4.8.0
pickleshare 0.7.5
Pillow 9.0.1
pip 21.2.4
ply 3.11
prometheus-client 0.13.1
promise 2.3
prompt-toolkit 3.0.20
protobuf 3.19.1
ptyprocess 0.7.0
pyasn1 0.4.8
pyasn1-modules 0.2.8
pybind11 2.9.1
pycparser 2.21
Pygments 2.11.2
PyJWT 2.1.0
pyOpenSSL 21.0.0
pyparsing 3.0.4
pyrsistent 0.18.0
PySocks 1.7.1
python-dateutil 2.8.2
pythran 0.9.11
pytz 2021.3
pyzmq 22.3.0
requests 2.27.1
requests-oauthlib 1.3.0
rsa 4.7.2
scikit-learn 1.0.2
scipy 1.7.1
Send2Trash 1.8.0
setuptools 58.0.4
six 1.15.0
sklearn 0.0
sniffio 1.2.0
tensorboard 2.8.0
tensorboard-data-server 0.6.1
tensorboard-plugin-wit 1.6.0
tensorflow-datasets 4.5.2
tensorflow-macos 2.8.0
tensorflow-metadata 1.6.0
tensorflow-metal 0.3.0
termcolor 1.1.0
terminado 0.13.1
testpath 0.5.0
tf-estimator-nightly 2.8.0.dev2021122109
threadpoolctl 2.2.0
tornado 6.1
tqdm 4.62.3
traitlets 5.1.1
typing-extensions 3.7.4.3
urllib3 1.26.8
wcwidth 0.2.5
webencodings 0.5.1
websocket-client 0.58.0
Werkzeug 2.0.2
wheel 0.35.1
wrapt 1.12.1
yarl 1.6.3
zipp 3.7.0
You can install using Rosetta2 Mode.
To work in Rosetta Mode:
If Rosetta 2 is not installed by default in your M1 Mac, then open the pre-installed Terminal app and run the following command:
/usr/sbin/softwareupdate --install-rosetta --agree-to-license
Rosetta allows us to use apps built for Mac with intel chip.
Several CLI tools do not have native versions built for the new M1 architecture.
Enabling them on your native M1 Mac terminal can be frustrating.
Follow these steps to enable Rosetta:
Select the app(Terminal) in the Finder.
Right click on the app(Terminal) and select Get Info.
In General, check the Open using Rosetta check-box.
Close the Terminal Info.
Now when you quit the terminal and open it again.
If you haven't installed Rosetta yet, then it would prompt you to install it.
If the popup shows up, then click on Install button, then enter your user name and password to allow installation to proceed.
Close the Terminal and open again.
Now we have a special terminal that can install tools with Rosetta translation.
To verify that you are using a Rosetta terminal, run the following command and it should output i386:
arch
The native terminal without Rosetta would output arm64 for the above command.
Moving forward, all commands we ask you to execute should be done in Rosetta enabled terminal.
Uninstall arm64 brew
If you have installed brew in the past from the native terminal, it is likely that you have an arm64 build of brew. Having two different builds of brew can cause major problems as the packages with different builds will not be compatible with each other.
To avoid this problem you need to uninstall your current installation of arm64 brew.
You can check which build you have by running the following command:
which brew
If your installation of brew is the Intel build, then the command should output /usr/local/bin/brew. If that is the case you can skip installing brew and just update your current installation by running brew update.
If your output is /opt/homebrew then your installation of brew is the arm64 build.
You need to uninstall the arm64 build of brew by running the following command from the native terminal:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall.sh)"
Install Intel brew
Install Homebrew, which is the package manager:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Once done, run the below command to ensure that we make use of the HEAD revision:
git -C $(brew --repository homebrew/core) checkout master
Now verify the installation of the brew command:
which brew
The command should output /usr/local/bin/brew, which is the expected path.

Package Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation 5.0.0 is not compatible with netcoreapp3.1

I'm trying to install Nuget package Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation on a .Net core 3.1 project and getting following error.
"Package Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation 5.0.0 is not compatible with netcoreapp3.1"
I have already updated all the existing packages but no luck.
Has anyone encountered this error?
Because Package Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation 5.0.0 depends on net5.0.
You should install a version compatible with .net core 3.1,like Package Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation -Version 3.x
For me this one worked in the integrated VS terminal.
dotnet add package Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation --version 3.1.10
Installed version 3.1.10 and resolved.
PM> Install-Package Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation -Version 3.1.10

"ERROR command failed: npm install --loglevel error" when trying to do "vue create"

Vue CLI v3.2.1
✨ Creating project in /home/mcaubrey511/portfolio.
🗃 Initializing git repository...
⚙ Installing CLI plugins. This might take a while...
> yorkie#2.0.0 install /home/mcaubrey511/portfolio/node_modules/yorkie
> node bin/install.js
ERROR command failed: npm install --loglevel error
Environment info
System:
OS: Linux 4.18 Ubuntu 18.10 (Cosmic Cuttlefish)
CPU: (1) x64 Intel(R) Xeon(R) CPU # 2.30GHz
Binaries:
Node: 10.14.1 - /usr/bin/node
npm: 6.4.1 - /usr/bin/npm
npmPackages:
#vue/babel-preset-app: 3.2.0
#vue/cli-overlay: 3.2.0
#vue/cli-plugin-babel: ^3.2.0 => 3.2.0
#vue/cli-plugin-eslint: ^3.2.0 => 3.2.1
#vue/cli-service: ^3.2.0 => 3.2.0
#vue/cli-shared-utils: 3.2.0
#vue/component-compiler-utils: 2.3.0
#vue/preload-webpack-plugin: 1.1.0
#vue/web-component-wrapper: 1.2.0
babel-helper-vue-jsx-merge-props: 2.0.3
babel-plugin-transform-vue-jsx: 4.0.1
eslint-plugin-vue: 4.7.1
vue-eslint-parser: 2.0.3
vue-hot-reload-api: 2.3.1
vue-loader: 15.4.2
vue-style-loader: 4.1.2
vue-template-es2015-compiler: 1.6.0
npmGlobalPackages:
#vue/cli: 3.2.1
Any idea what's wrong or what I could do to get it working?
After switching the machine I was using to Ubuntu 18.04 LTS I am no longer having the problem. I made an issue on the vue-cli repository and it seems like at least one other person is having a similar problem, but with a different environment.
If you do apt-get update in terminal before installing the vue/cli, the issue will be solved.
In a nutshell, apt-get update doesn't actually install new versions of software. Instead, it updates the package lists for upgrades for packages that need upgrading, as well as new packages that have just come to the repositories.
apt-get update downloads the package lists from the repositories and "updates" them to get information on the newest versions of packages and their dependencies. It will do this for all repositories and PPAs.

Version conflict detected for Microsoft.CodeAnalysis.Common. Reference the package directly from the project to resolve this issue

I want to add the FluentValidation Nuget package in my asp.net core app through Nuget Package Manager.While adding I get this error:
Severity Code Description Project File Line Suppression State
Error Version conflict detected for Microsoft.CodeAnalysis.Common.
Reference the package directly from the project to resolve this issue.
Project Name -> FluentValidation.AspNetCore 7.6.103 ->
Microsoft.AspNetCore.Mvc 2.1.0 -> Microsoft.AspNetCore.Mvc.TagHelpers
2.1.0 -> Microsoft.AspNetCore.Mvc.Razor 2.1.0 -> Microsoft.CodeAnalysis.Razor 2.1.0 -> Microsoft.CodeAnalysis.Common
(>= 2.8.0) Project Name ->
Microsoft.VisualStudio.Web.CodeGeneration.Design 2.0.0 ->
Microsoft.VisualStudio.Web.CodeGenerators.Mvc 2.0.0 ->
Microsoft.VisualStudio.Web.CodeGeneration 2.0.0 ->
Microsoft.VisualStudio.Web.CodeGeneration.EntityFrameworkCore 2.0.0 ->
Microsoft.VisualStudio.Web.CodeGeneration.Core 2.0.0 ->
Microsoft.VisualStudio.Web.CodeGeneration.Templating 2.0.0 ->
Microsoft.VisualStudio.Web.CodeGeneration.Utils 2.0.0 ->
Microsoft.CodeAnalysis.CSharp.Workspaces 2.3.1 ->
Microsoft.CodeAnalysis.Workspaces.Common 2.3.1 ->
Microsoft.CodeAnalysis.Common (= 2.3.1).
How can I solve this error?
I had the same problem and was upgrading to 2.1, but for some reason I needed to manually upgrade my Microsoft.CodeAnalysis.Common package from 2.8.0 to 2.8.2
Install-Package Microsoft.CodeAnalysis.Common -Version 2.8.2
Just faced the same issue.
Unfortunately, this package refers to .net core 2.1, which is incompatible with 2.0.
Here's how I managed to resolve this issue:
- Install the 2.1 SDK from https://www.microsoft.com/net/download/windows
- Follow migration instructions from https://learn.microsoft.com/en-us/aspnet/core/migration/20_21?view=aspnetcore-2.1
Hope it helps!
If you're project is running under .NET Core 3.1 LTS
Then please install the following package into your targeted project.
Install-Package Microsoft.CodeAnalysis.Common -Version 3.6.0
And then
Install-Package Microsoft.CodeAnalysis.CSharp.Workspaces -Version 3.6.0
This will resolve your problem.

npm update is not honoring the results of npm outdated

I ran npm outdated on a project - it showed that there were several outdated packages. So I ran npm update - it updated a few packages but not all. If I run npm outdated again it still shows the remaining packages that are outdated:
Package Current Wanted Latest
babel-loader 7.1.1 7.1.1 7.1.2
babel-runtime 6.23.0 6.23.0 6.26.0
chalk 2.0.1 2.0.1 2.1.0
css-loader 0.28.4 0.28.4 0.28.5
eslint 4.2.0 4.2.0 4.5.0
eslint-plugin-react 7.1.0 7.1.0 7.2.1
fs-extra 4.0.0 4.0.0 4.0.1
html-webpack-plugin 2.29.0 2.29.0 2.30.1
material-ui 1.0.0-beta.5 1.0.0-beta.5 0.19.0
postcss-flexbugs-fixes 3.0.0 3.0.0 3.2.0
react-stripe-elements 0.0.2 0.0.2 0.0.7
webpack 3.3.0 3.3.0 3.5.5
webpack-dev-server 2.5.1 2.5.1 2.7.1
webpack-manifest-plugin 1.1.2 1.1.2 1.3.1
If I try to run npm update again, it does nothing!
Why are the two commands telling me different things?
Thanks in advance.
If you run npm update and some of the packages defined in package.json have their version pinned, it will not update. That is why you see three columns when you run npm outdated. The current installed version, the latest version that matches what is defined in your package.json, and finally, the actual latest version.