SalesforceCommerceCloud/pwa-kit

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

开放

#830 创建于 2022年11月17日

 (2 条评论) (0 个反应) (0 位负责人)JavaScript (234 个派生)github user discovery
AcknowledgedBUG P3good first issue

仓库指标

星标
 (359 个星标)
PR 合并指标
 (平均合并 2天 11小时) (30 天内合并 38 个 PR)

描述

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)

贡献者指南