javascript - Spaces in PATH npm - Stack Overflow

So I've been trying to install gulp and I keep getting:module.js:471^throw err : cannot find modul

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.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1743732588a4497693.html

相关推荐

  • javascript - Spaces in PATH npm - Stack Overflow

    So I've been trying to install gulp and I keep getting:module.js:471^throw err : cannot find modul

    6天前
    10

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信