Having trouble installing NPM packages for a Shopify app

jazilzaim
New Member
1 0 0

I am building a Shopify app. I want to install Axios as an NPM package. The app is built with the Shopify CLI. Whenever I try to run the app, this is what I get:

┃ event - compiled successfully
┃ events.js:292
┃ throw er; // Unhandled 'error' event
┃ ^

┃ Error: listen EADDRINUSE: address already in use :::8081
┃ at Server.setupListenHandle [as _listen2] (net.js:1313:16)
┃ at listenInCluster (net.js:1361:12)
┃ at Server.listen (net.js:1447:7)
┃ at Application.listen (/Users/jazilzaim/Desktop/fyresale/node_modules/koa/lib/application.js:82:19)
┃ at /Users/jazilzaim/Desktop/fyresale/server/server.js:59:10
┃ Emitted 'error' event on Server instance at:
┃ at emitErrorNT (net.js:1340:8)
┃ at processTicksAndRejections (internal/process/task_queues.js:84:21) {
┃ code: 'EADDRINUSE',
┃ errno: 'EADDRINUSE',
┃ syscall: 'listen',
┃ address: '::',
┃ port: 8081
┃ }
┃ [nodemon] app crashed - waiting for file changes before starting...

 

This is something I have been having troubles with for at least a few weeks now. Is there any solution to this perhaps? Or any way to install NPM packages in a Shopify app (built with the Shopify CLI)?

0 Likes
olivert
Explorer
51 11 15

Hey there,

This means there is an existing node service running. 
so when you attempt to fire up another service it'll fail.

I usually get this when I close a node session with CTRL + Z instead of CTRL + C

CTRL + Z suspends the session. but doesn't kill it
you can resume this session by using the "bg" command in a shell.

CTRL + C kills the session

check your existing sessions with:

ps aux | grep node

or just restart your comp does that help?

0 Likes