SalesforceCommerceCloud/pwa-kit

[BUG] App cannot be started if installed in a directory with spaces in the name

Aberta

#830 aberto em 17 de nov. de 2022

 (2 comentários) (0 reação) (0 responsável)JavaScript (234 forks)github user discovery
AcknowledgedBUG P3good first issue

Métricas do repositório

Stars
 (359 estrelas)
Métricas de merge de PR
 (Mesclagem média 2d 11h) (38 fundiu PRs em 30d)

Description

Summary

I've tried to install the PWA kit on my machine by following the quick start guide but it turned out I can't start the app if my path has spaces inside.

Steps To Reproduce

npx pwa-kit-create-app@latest --preset retail-react-app-demo
cd pwa-kit-starter-project
npm start

Error:

> demo-storefront@0.0.1 start C:\Users\Enis Work\dev\pwa-kit\pwa-kit-starter-project
> cross-env NODE_ICU_DATA=node_modules/full-icu pwa-kit-dev start

internal/modules/cjs/loader.js:905
  throw err;
  ^

Error: Cannot find module 'C:\Users\Enis'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15)
    at Function.Module._load (internal/modules/cjs/loader.js:746:27)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12)
    at internal/main/run_main_module.js:17:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}
Command failed: node C:\Users\Enis Work\dev\pwa-kit\pwa-kit-starter-project\app\ssr.js
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! demo-storefront@0.0.1 start: `cross-env NODE_ICU_DATA=node_modules/full-icu pwa-kit-dev start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the demo-storefront@0.0.1 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

Expected result

The app can be started as expected. Note: Everything works fine if I do the same with a Windows User without spaces in the name/path.

Actual result

The app is installed but I'm not able to start it. Looks like the path gets cut off where the space is ("Enis Work") and cannot be resolved.

Error: Cannot find module 'C:\Users\Enis'

System Information (as applicable)

Node version: v14.18.0 (also tried v16.9.1) NPM version: v6.14.15 pwa-kit version: v2.3.0 Desktop OS: Windows 10 (x64)

Guia do colaborador