SalesforceCommerceCloud / pwa-kit

React-based JavaScript frontend framework to create a progressive web app (PWA) storefront for Salesforce B2C Commerce.
https://developer.salesforce.com/docs/commerce/pwa-kit-managed-runtime/guide/pwa-kit-overview.html
BSD 3-Clause "New" or "Revised" License
276 stars 124 forks source link

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

Open eismail-aiopsgroup opened 1 year ago

eismail-aiopsgroup commented 1 year ago

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)

bendvc commented 1 year ago

Thanks for the report @eismail-aiopsgroup, we'll track this internally and schedule the work within the team.

git2gus[bot] commented 1 year ago

This issue has been linked to a new work item: W-12082775