Skip to content
This repository has been archived by the owner on May 13, 2024. It is now read-only.

Ionic vscode extension doesn’t work due to user name has space in nodejs path #52

Closed
seanli2468 opened this issue Jul 4, 2022 · 2 comments
Labels
cant fix The problem cant be fixed: its an issue that requires an external fix

Comments

@seanli2468
Copy link

I installed the ionic extension in vscode recently. I created an empty folder and opened it in the extension. However, when I clicked the ionic icon, I didn’t get these three Projects in vscode - New Angular Project, New React Project and New Vue Project. Instead, I got an error that is listed in below:

node:internal/modules/cjs/loader:936 throw err; ^ Error: Cannot find module ‘c:\Users\Sean’ at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15) at Function.Module._load (node:internal/modules/cjs/loader:778:27) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12) at node:internal/main/run_main_module:17:47 { code: ‘MODULE_NOT_FOUND’, requireStack: }

I realised that I have a space in my user name (Sean Li) under the Users folder that caused the error. If I create another user without space in my Windows and install the extension in vscode, it will succeed; but, I don’t want to do this way as I have installed many application under my current user profile. I tried to fix the error by following this thread in Stack Overflow (Spaces in PATH npm) and executed this command:
npm config set cache “C:\Users\Sean~1\AppData\Roaming\npm-cache” --global

Unfortunately it didn’t work. I spent several days to fix this error without success. Can anybody please point out a direction to fix the error? Thanks a lot in advance.

@dtarnawsky
Copy link

Hi @seanli2468 ,

I was able to reproduce this issue. It appears to be an open issue with npm:
npm/cmd-shim#45

There is an outstanding PR to fix the problem but it looks like it won't be merged as it needs to be rebased.

Your best bet may be to rename your user folder:
https://www.minitool.com/news/change-user-folder-name-windows-10.html
or
https://www.tenforums.com/tutorials/89060-change-name-user-profile-folder-windows-10-a.html

@dtarnawsky dtarnawsky added the cant fix The problem cant be fixed: its an issue that requires an external fix label Jul 5, 2022
@seanli2468
Copy link
Author

I don't want to mess up with my registry. I am going to create another windows account to finish my ionic project as it is a safer way. Thanks for help anyway.

@dtarnawsky dtarnawsky closed this as not planned Won't fix, can't repro, duplicate, stale Jul 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cant fix The problem cant be fixed: its an issue that requires an external fix
Projects
None yet
Development

No branches or pull requests

2 participants