jejuro
From today morning, I CAN’T generate a new Phoenix app, because it stops at command “npm install && node node_modules/webpack/bin/webpack.js --mode development” with error messages like below.
ERROR in ./js/app.js
Module build failed: Error: Package exports for ‘/Users/Jupeter/hello/assets/node_modules/@babel/helper-compilation-targets’ do not define a ‘.’ subpath …
…
or;
ERROR in ./js/app.js
Module build failed (from ./node_modules/babel-loader/lib/index.js):
Error: Package exports for ‘/Users/Jupeter/hello/assets/node_modules/@babel/helper-compilation-targets’ do not define a ‘.’ subpath …
…
To solve this issue, I have spent a few hours including updating npm, webpack, and babel etc., but all efforts are in vain.
Any idea?
Thanks in advance.
PS> I asked it on stackoverflow with more details.
Trending in Questions
Other Trending Topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #ai
- #elixirconf-us
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #elixirconf-eu
- #metaprogramming
- #hex










Showing Posts 11 to 20- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
jejuro
Now another warning appears.
mindok
That new warning looks like you didn’t copy in the full command-line (truncated at --mod rather than --mode development)
Can you test (maybe with some other framework) that your node / webpack infrastructure is behaving?
Do you have another machine that you can try?
Have you tried updating all your npm dependencies to the latest?
jejuro
I am sure Phoenix will work on another machine as it has worked until today without problem.
I have updated all my npm dependencies. First, I removed the default “assets/node_modules”, and then, reinstall the dependencies like;
$ npm install --prefix assets
But, the issue continues. I will remove all the node.js related items, and reinstall them.
I am a refugee from JS spagetti eco-system, and have enjoyed the wonderful elixir+phoenix land for two months until now. But, the nodejs ghost still follows me…
jejuro
This is the full error message.
jejuro
I have removed all node related files from my computer, then reinstall nodejs.
Problem solved.
Does Phoenix LiveView also need webpack, babel and other nodejs modules? I hope another world without JS stubs.
Thank you all.
I have really enjoyed learning elixir, phoenix, and ecto for the last two months, and today was the hardest day due to the nodejs stubs such as webpack and babel.
dimitarvp
I was about to say that it’s likely your Node installation is old.
As far as I am aware, no. LiveView is supposed to require very minimal JS that basically maintains the WebSockets connection and encode/decode data in transit.
wolfiton
@jejuro do you still want to learn how to use asdf?(I was away when you posted)
jejuro
Yes, please. I have googled it, but couldn’t find helpful tutorials or guides. The official site is too simple for beginners.
Thanks everyone. I really appreciate it.
wolfiton
So i have Ubuntu as a system but you have Mac so you will probably use brew to install things.
Read the Important section a the end before starting following this guide
So let’s get started:
Head down here first:
Choose one of the two:
Using git(Recommended way)
This is using brew
Now if you use git do the following
Add to your Shell
I personally use zsh with antigen (you can read more here Kubuntu against my old Bodhi Linux)
For zsh
For brew install use this
Add to shell
For zsh
Find asdf.sh and add to zsh
Following this command but locating the file
Now to be able to install plugins add the following deps via homebrew or spack
Brew
Spack
Verify that asdf is a known command to your shell by typing asdf
Now we are ready to add the plugins:
Here are all the plugins available: asdf
We will use the Erlang plugin the Elixir plugin
Erlang
So head down to: GitHub - asdf-vm/asdf-erlang: Erlang plugin for asdf version manager · GitHub
Before installing the Erlang plugin
OSX
These packages you have to install in order for the Erlang plugin to compile:
Install the build tools
brew install autoconfFor building with wxWidgets (start observer or debugger!)
brew install wxmacDealing with OpenSSL issues on macOS
You may encounter an SSL error with an output along these lines:
This issue has been documented on
kerl. If you see this error, you can use the--with-sslflag with a path (in this case, the path is1.0.2p, you should verify the correct path) before installing Erlang. Here is an example that skips the java depency and also sets a specific (and existing) path for OpenSSL on macOS.Now we are ready for the actual install
So use the following command:
Give it time to compile, you can even go drink a coffee, because it will take some time to do this.
After it is done
Let’s get elixir:
head down here:
then use this command:
After elixir is installed you can install phoenix normally and it should all work
Here is the guide: Installation — Phoenix v1.8.8
mix local.hexif you already have it it will upgrade it to the latest versionmix archive.install hex phx_new 1.4.11and yopu should be able now to use phoenix without worries.!! Important
I hope this will help you and others, that have issues with phoenix installation
wolfiton
Also I sent a request to the wonderful admins of the forums to verify if my guide is correct because i don’t have a Mac OS to test this.
So before following it wait for the OK from them.
Thanks for you patience