Ngrok start server problem - shopify app serve run with error

Hello all,

I hope someone can help me. I tried it the whole day but nothing works. I followed the GetStarted tutorial (https://shopify.dev/apps/getting-started/create) and set up everything necessary. Every time I try to run the “shopify app serve” command it only returns an error to me. I don’t know how I can solve this.

Steps are done:

  • Logged in in Shopify
  • I created the initial app with the Shopify CLI through “Shopify app node create”
  • “shopify app tunnel auth” with the ngrok token
  • npm installed and logged in through the console
  • Node.js installed

Here is my log (i overwrote some private path parts):

━ Running server… ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

┃ > [email removed] dev
┃ > cross-env NODE_ENV=development nodemon ./server/index.js --watch ./server/index.js

┃ [nodemon] 2.0.15
┃ [nodemon] to restart at any time, enter rs
┃ [nodemon] watching path(s): server\index.js
┃ [nodemon] watching extensions: js,mjs,json
┃ [nodemon] starting node ./server/index.js
┃ Browserslist: caniuse-lite is outdated. Please run:
┃ npx [email removed] --update-db

┃ Why you should do it regularly:
https://github.com/browserslist/browserslist#browsers-data-updating
┃ Browserslist: caniuse-lite is outdated. Please run:
┃ npx [email removed] --update-db
┃ node:internal/modules/cjs/loader:488
┃ throw e;
┃ ^

┃ Error: Package subpath ‘./lib/parser’ is not defined by “exports” in C:\Users\path\node_modules\next\node_modules\postcss\package.json
┃ at new NodeError (node:internal/errors:371:5)
┃ at throwExportsNotFound (node:internal/modules/esm/resolve:429:9)
┃ at packageExportsResolve (node:internal/modules/esm/resolve:703:3)
┃ at resolveExports (node:internal/modules/cjs/loader:482:36)
┃ at Function.Module._findPath (node:internal/modules/cjs/loader:522:31)
┃ at Function.Module._resolveFilename (node:internal/modules/cjs/loader:919:27)
┃ at Function.Module._load (node:internal/modules/cjs/loader:778:27)
┃ at Module.require (node:internal/modules/cjs/loader:999:19)
┃ at require (node:internal/modules/cjs/helpers:102:18)
┃ at Object.552 (C:\Users\path\node_modules\next\dist\compiled\postcss-scss\scss-syntax.js:1:11590)
┃ at webpack_require (C:\Users\path\node_modules\next\dist\compiled\postcss-scss\scss-syntax.js:1:11735)
┃ at Object.560 (C:\Users\path\node_modules\next\dist\compiled\postcss-scss\scss-syntax.js:1:400)
┃ at webpack_require (C:\Users\path\node_modules\next\dist\compiled\postcss-scss\scss-syntax.js:1:11735)
┃ at Object.290 (C:\Users\path\node_modules\next\dist\compiled\postcss-scss\scss-syntax.js:1:260)
┃ at webpack_require (C:\Users\path\node_modules\next\dist\compiled\postcss-scss\scss-syntax.js:1:11735)
┃ at Object.632 (C:\Users\path\node_modules\next\dist\compiled\postcss-scss\scss-syntax.js:1:3733) {
┃ code: ‘ERR_PACKAGE_PATH_NOT_EXPORTED’
┃ }

┃ Node.js v17.4.0
┃ [nodemon] app crashed - waiting for file changes before starting…

Thank you in advance!

Greetings

Mike

Hi mate

I encounter the same problem.

But my problem was fixed by running :

npm audit fix --force

Before running the app

shopify app serve

Hope this can help :slightly_smiling_face:

After some searching myself it turns out Shopifys local dev tools are not compatible with node 17. The fix I found was to roll back my node version and use the long term support version with this command:

nvm install --lts

My output from that command looked like this:

Installing latest LTS version.
Downloading and installing node v16.13.2...
Downloading https://nodejs.org/dist/v16.13.2/node-v16.13.2-darwin-x64.tar.xz...
######################################################################### 100.0%
Computing checksum with sha256sum
Checksums matched!
Now using node v16.13.2 (npm v8.1.2)
Creating default alias: default -> lts/* (-> v16.13.2)

Then I ran shopify without issues:

shopify app serve

@Mr_M does your problems solved.

First connect the app then run app serve

shopify app connect
shopify app serve