最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Spaces in PATH npm - Stack Overflow

programmeradmin0浏览0评论

So I've been trying to install gulp and I keep getting:

module.js:471^throw err : cannot find module 'C:\c\Users\Joe's Steezy Laptop\AppData\Roaming\npm\node_modules\gulp-cli\bin\gulp.js'

As you can see my username has spaces in it and I read that npm cant read paths that have spaces. my question is how do i fix this? I know theres the option to do symbolic links, and there is an option to make a whole new user and make sure the username folder doesn't have any spaces in it this time.

Is there another way I can do this? I don't trust myself enough to do a symbolic link because i read that it can really mess up your system if you mess it up. I also don't really want to make a whole new user on my laptop because then i have to install all my programs all over again which kind of sucks. Please if anyone can help, it would be much appreciated!

So I've been trying to install gulp and I keep getting:

module.js:471^throw err : cannot find module 'C:\c\Users\Joe's Steezy Laptop\AppData\Roaming\npm\node_modules\gulp-cli\bin\gulp.js'

As you can see my username has spaces in it and I read that npm cant read paths that have spaces. my question is how do i fix this? I know theres the option to do symbolic links, and there is an option to make a whole new user and make sure the username folder doesn't have any spaces in it this time.

Is there another way I can do this? I don't trust myself enough to do a symbolic link because i read that it can really mess up your system if you mess it up. I also don't really want to make a whole new user on my laptop because then i have to install all my programs all over again which kind of sucks. Please if anyone can help, it would be much appreciated!

Share Improve this question edited Oct 23, 2017 at 7:17 kgangadhar 5,0885 gold badges38 silver badges58 bronze badges asked Oct 22, 2017 at 7:12 Joe EscobedoJoe Escobedo 2751 gold badge4 silver badges17 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 5

This is for those who all are facing the issue and didn't get any workaround. What you can do is change the cache path using below mand:

npm config set cache "C:\Users\FirstName~1\AppData\Roaming\npm-cache" --global

Here FirstName is path name which includes spaces between them.

This works for windows. You can use the short path name in the environment variable, e.g. use "C:\PROGRA~1\nodejs" instead of "C:\Progam Files\nodejs".

You can find out the correct short name of your folder by executing dir /x in the parent folder.

发布评论

评论列表(0)

  1. 暂无评论