NPM referencing incorrect user directory

I’m facing an issue while starting a new project. It keeps pointing to the wrong user directory, and I’m not sure why. Here’s what happens when I try to create a project:

C:\Users\Jeffrey Desktop\Documents\ServiceNow\Components>now-cli project --name @dev94659/test-project --description 'A test web component'
Created scope "x_23747_dev94659_2"

'C:\Users\Jeffrey' is not recognized as an internal or external command,
operable program or batch file.

This is my current user directory:

C:\Users\Jeffrey Desktop

Can anyone explain why it’s referencing “C:\Users\Jeffrey”? Any help would be appreciated.

The issue you’re encountering is likely due to the space in your user directory name. When commands are executed in the command line, a space can cause the command interpreter to misinterpret your path. A solution is to enclose your path in quotes. Alternatively, consider using the short path version of your directory, which eliminates spaces. You can find this by using the dir /x command in the parent directory, allowing you to access the directory without issues. Another approach is to create your project in a directory without spaces in the name.

yup, total classic path issue! that space in “Jeffrey Desktop” is messing things up. try moving to a folder without spaces before running the now-cli command. wrapping the path in quotes might help, but really, best to avoid spaces in usernames and folders if u can.

Windows command line treats spaces as separators, so your username “Jeffrey Desktop” breaks the path. I’ve hit this issue before too. The easiest fix is moving your projects to something like C:\dev\ or C:\projects, where there are no spaces to worry about. You can also wrap the path in quotes when running commands, or just use PowerShell since it handles spaces much better.