ariandanim
(HELP) Upgrading NPM in assets folder Phoenix Framework
My App Spec:
- Erlang/OTP 23 [erts-11.1.5] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [hipe] [dtrace]
- Elixir 1.11.3 (compiled with Erlang/OTP 23)
- Phoenix 1.5.7
- NPM version 7.3.0
- Node Js version 15.5.0
when i try to access the assets folder then typing "npm install"it shows like this:
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! Found: webpack@5.12.2
npm ERR! node_modules/webpack
npm ERR! dev webpack@“4.41.5” from the root project
npm ERR! peer webpack@“>=2” from babel-loader@8.2.2
npm ERR! node_modules/babel-loader
npm ERR! dev babel-loader@“^8.0.0” from the root project
npm ERR! 3 more (copy-webpack-plugin, css-loader, hard-source-webpack-plugin)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! dev mini-css-extract-plugin@“^0.9.0” from the root project
npm ERR!
npm ERR! Conflicting peer dependency: webpack@4.45.0
npm ERR! node_modules/webpack
npm ERR! peer webpack@“^4.4.0” from mini-css-extract-plugin@0.9.0
npm ERR! node_modules/mini-css-extract-plugin
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.
npm ERR!
Then i try to install node modules in assets folder typing "npm install --legacy-peer-deps"then show like this:
npm WARN deprecated urix@0.1.0: Please see GitHub - lydell/urix: [DEPRECATED] Makes Windows-style paths more unix and URI friendly. · GitHub
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated resolve-url@0.2.1: GitHub - lydell/resolve-url: [DEPRECATED] Like Node.js’ `path.resolve`/`url.resolve` for the browser. · GitHub
npm WARN deprecated fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm WARN deprecated chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142added 913 packages, and audited 916 packages in 3m
44 packages are looking for funding
runnpm fundfor detailsfound 0 vulnerabilities
i am wondering what the the warn deprecated above, so i typed in assets folder "npm outdated"then shows like this:
Package Current Wanted Latest Location Depended by
copy-webpack-plugin 5.1.2 5.1.2 7.0.0 node_modules/copy-webpack-plugin assets
css-loader 3.6.0 3.6.0 5.0.1 node_modules/css-loader assets
mini-css-extract-plugin 0.9.0 0.9.0 1.3.3 node_modules/mini-css-extract-plugin assets
node-sass 4.14.1 4.14.1 5.0.0 node_modules/node-sass assets
sass-loader 8.0.2 8.0.2 10.1.0 node_modules/sass-loader assets
terser-webpack-plugin 2.3.8 2.3.8 5.1.1 node_modules/terser-webpack-plugin assets
webpack 4.41.5 4.41.5 5.12.2 node_modules/webpack assets
webpack-cli 3.3.12 3.3.12 4.3.1 node_modules/webpack-cli assets
Question is, does is safe if i upgrading my assets folder the NPM plugin?
Trending in Questions
Other Trending Topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #elixirconf-us
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #metaprogramming
- #hex
- #performance










First 10 of 11 Posts
kokolegorille
Hello and welcome…
Yes it is, but as for all major changes, You need update configuration. This time it’s webpack going to version 5.
You might follow this post about PR to Upgrade to webpack 5 - #12 by webuhu
ariandanim
Tkyou,
how i set for the first time create my App without editing manual the package ? or still should i edit manually?
kokolegorille
I do it manually.
kokolegorille
… with the help of this package.
https://www.npmjs.com/package/npm-check-updates
You need to know that there might be some breaking changes when updating, and You need to configure those files…
assets/webpack.config.js
Be sure to follow PR update path
config/dev.exs
Update this part.
This is a simple example of ncu, from the assets folder.
As You can see there are some minor changes, and it’s probably safe to run ncu -u. But if You see some majors changing… You need to check for configuration update.
This is not really Phoenix related, but by default it uses Webpack to bundle your assets.
ariandanim
when i typed ncu in my assets folder is show nothing, only said command not found
kokolegorille
You need to install it with
ariandanim
after i typed “npm install -g npm-check-updates”, then show like this:
when i tried typed “npm install”, the message showing like this:
so i tried typed “npm install --force” then show like this :
once again i tried typing "npm install -g npm-check-updates"and show like this:
then i go to main folder project typing “mix ecto.create”
then typing “mix phx.server” then show like this:
the WEBPACK is still version 4
Do i missing something steps? please help..
ariandanim
Continue with my comment above..
i try typed “npm install --legacy-peer-deps” in my assets folder then show like this
then i typed ncu, its showing like this:
then i go to my main folder app and typing “mix phx.server” then showing error like this:
i don’t know what next… T_T
kokolegorille
You really need to follow the PR I linked in my first post, because it won’t work otherwise…
You need to update config/dev.exs
And webpack.config.js
ariandanim
thankyou bro, its works, here my step according the PR
in my app folder config/dev.exs : i am remove this line
then replace with this line :
after that i go to folder assets/package.json then i remove this line in the below dependencies:
and replace with this line :
after that i go to assets/webpack.config.js i remove all the line then replace with this line
here is the link to make changes some file
https://github.com/phoenixframework/phoenix/commit/c364104ed69ef955e3fc5c48426a8da1b530fc30