aws-amplify / aws-amplify/amplify-cli

Amplify errors when Windows directories have spaces in them

Open
#10,524 1 comment 0 reactions 1 assignee Claimed by @ykethan View on GitHub
bug p2 windows
Dominant language
TypeScript
Stars
2.9k
Forks
825
Avg merge
11d 23h
Merged PRs (30d)
2

Description

### Before opening, please confirm:

- [X] I have installed the latest version of the Amplify CLI (see above), and confirmed that the issue still persists.
- [X] I have [searched for duplicate or closed issues](https://github.com/aws-amplify/amplify-cli/issues?q=is%3Aissue+).
- [X] I have read the guide for [submitting bug reports](https://github.com/aws-amplify/amplify-cli/blob/master/CONTRIBUTING.md#bug-reports).
- [X] I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
- [X] I have removed any sensitive information from my code snippets and submission.

### How did you install the Amplify CLI?

npm

### If applicable, what version of Node.js are you using?

16.10.0

### Amplify CLI Version

8.3.1

### What operating system are you using?

Windows

### Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.

No

### Amplify Categories

Not applicable

### Amplify Commands

pull

### Describe the bug

I've just installed node, npm and amplify on a Windows 10 pc, and I'm having a problem with it not finding the amplify directory. The reason seems to be that there's a space bar in the directory name.

The installer put amplify in the directory

`C:\Users\John Smith\.amplify\bin\amplify.exe`

And the space in the folder name "John Smith" is causing a problem. For example, when I run

`amplify pull --sandboxId [My id number here]`

I get

`'C:\Users\John' is not recognized as an internal or external command`

Has anyone encountered this, or know of a fix?

### Expected behavior

I expected it to run a successful pull command

### Reproduction steps

Go to new project root folder. Run this command:

`amplify pull --sandboxId [My user id here]`

You get this error message:

`✅ Amplify project setup for javascript platform
✅ Framework detected: react
🎸 Creating base Amplify project
'C:\Users\John' is not recognized as an internal or external command,
operable program or batch file.
❌ Failed to create base Amplify Project
Error: Error: Command failed with exit code 1: cmd /V /C "set PKG_EXECPATH= && C:\Users\John Smith\.amplify\bin\amplify.exe init --quickstart --frontend javascript"
at createAmplifySkeletonProject (C:\snapshot\repo\build\node_modules\amplify-app\src\index.js:156:11)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
at async run (C:\snapshot\repo\build\node_modules\amplify-app\src\index.js:53:7)
at async preDeployPullBackend (C:\snapshot\repo\build\node_modules\@aws-amplify\cli-internal\lib\pre-deployment-pull.js:62:9)
at async Object.run (C:\snapshot\repo\build\node_modules\@aws-amplify\cli-internal\lib\commands\pull.js:20:13)
at async Object.executeAmplifyCommand (C:\snapshot\repo\build\node_modules\@aws-amplify\cli-internal\lib\index.js:285:9)
at async executePluginModuleCommand (C:\snapshot\repo\build\node_modules\@aws-amplify\cli-internal\lib\execution-manager.js:142:5)
at async executeCommand (C:\snapshot\repo\build\node_modules\@aws-amplify\cli-internal\lib\execution-manager.js:40:9)
at async Object.run (C:\snapshot\repo\build\node_modules\@aws-amplify\cli-internal\lib\index.js:163:9)
Failed to pull sandbox app: ENOENT: no such file or directory, open 'C:\projects\amptest\react-amplified\amplify\backend\api\amplifyDatasource\schema.graphql'
⚠️ Review the Amplify CLI troubleshooting guide for potential next steps: https://docs.amplify.aws/cli/project/troubleshooting/`

### GraphQL schema(s)

```graphql
# Put schemas below this line

```

### Log output

```
# Put your logs below this line

2022-06-03T14:13:42.463Z|info : amplify pull core {"sandboxId":"[***]9c86-[***]16-[***]4d-[***]b4-[***]e5248","yes":false}
2022-06-03T14:13:42.503Z|info : amplify-cli-core.banner-message/index.ts.fetch banner messages from https://aws-amplify.github.io/amplify-cli/banner-message.json({}
2022-06-03T14:24:36.698Z|info : amplify version core

```

### Additional information

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.