bcomnes / npm-run-all2

A CLI tool to run multiple npm-scripts in parallel or sequential. (Maintenance fork)
MIT License
250 stars 12 forks source link

Shopify CLI + VITE: Error when running #153

Open leebaroneau opened 22 hours ago

leebaroneau commented 22 hours ago

Hi!

Currently I'm getting this error when trying to run Shopify CLI + VITE. I tried to run a single command and it still threw a similar error.

Package.json

{
  "scripts": {
    "shopify:dev": "shopify theme dev --legacy --port 9000 --store fa0f41.myshopify.com --live-reload full-page",
    "shopify:logout": "shopify auth logout",
    "vite:dev": "vite dev",
    "vite:build": "vite build",
    "kill": "Taskkill /IM node.exe /F"
  },
  "type": "module",
  "devDependencies": {
    "@shopify/cli": "^3.67.0",
    "@shopify/theme": "^3",
    "autoprefixer": "^10",
    "daisyui": "^4.12.10",
    "npm-run-all2": "^6.2.3",
    "postcss": "^8",
    "tailwindcss": "^3",
    "vite": "^5.4.3",
    "vite-plugin-page-reload": "^0.2.0",
    "vite-plugin-shopify": "^3.0.1"
  }
}

Error in console after running: npm-run-all shopify:dev vite:dev

node:events:496
      throw er; // Unhandled 'error' event
      ^

Error: spawn which ENOENT
    at notFoundError (C:\Users\lee\AppData\Roaming\npm\node_modules\npm-run-all2\node_modules\cross-spawn\lib\enoent.js:6:26)
    at verifyENOENT (C:\Users\lee\AppData\Roaming\npm\node_modules\npm-run-all2\node_modules\cross-spawn\lib\enoent.js:40:16)
    at cp.emit (C:\Users\lee\AppData\Roaming\npm\node_modules\npm-run-all2\node_modules\cross-spawn\lib\enoent.js:27:25)
    at ChildProcess._handle.onexit (node:internal/child_process:294:12)
Emitted 'error' event on ChildProcess instance at:
    at cp.emit (C:\Users\lee\AppData\Roaming\npm\node_modules\npm-run-all2\node_modules\cross-spawn\lib\enoent.js:30:37)
    at ChildProcess._handle.onexit (node:internal/child_process:294:12) {
  code: 'ENOENT',
  errno: 'ENOENT',
  syscall: 'spawn which',
  path: 'which',
  spawnargs: []
}

Node.js v20.11.1 

Error after running single command: npm-run-all shopify:dev

node:events:496
      throw er; // Unhandled 'error' event
      ^

Error: spawn which ENOENT
    at notFoundError (C:\Users\lee\AppData\Roaming\npm\node_modules\npm-run-all2\node_modules\cross-spawn\lib\enoent.js:6:26)
    at verifyENOENT (C:\Users\lee\AppData\Roaming\npm\node_modules\npm-run-all2\node_modules\cross-spawn\lib\enoent.js:40:16)
    at cp.emit (C:\Users\lee\AppData\Roaming\npm\node_modules\npm-run-all2\node_modules\cross-spawn\lib\enoent.js:27:25)
    at ChildProcess._handle.onexit (node:internal/child_process:294:12)
Emitted 'error' event on ChildProcess instance at:
    at cp.emit (C:\Users\lee\AppData\Roaming\npm\node_modules\npm-run-all2\node_modules\cross-spawn\lib\enoent.js:30:37)
    at ChildProcess._handle.onexit (node:internal/child_process:294:12) {
  code: 'ENOENT',
  errno: 'ENOENT',
  syscall: 'spawn which',
  path: 'which',
  spawnargs: []
}

Node.js v20.11.1
bcomnes commented 7 hours ago

Thanks, probably windows specific bug around yarn/pnpm support paths. I'll some better error handling here.

In the meantime, running this same thing in a a shell that supports the POSIX which command should work.