无法安装gulp-sass [英] Cannot Install gulp-sass

查看:452
本文介绍了无法安装gulp-sass的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图学习如何使用gulp / sass /和所有其他有趣的工具和Nodejs,并且我遇到了安装gulp-sass的问题。我用来安装一切的过程是:

  1。在项目文件夹
中启动Git Bash 2. npm init
3. npm install gulp -g $ b $ 4. npm install gulp --save-dev
5. npm install gulp- sass< - 这是我得到错误的地方

一旦我到达第五步,我会得到以下错误:

  $ npm install gulp-sass 
npm WARN package.json project@1.0.0没有存储库字段。
npm WARN package.json project@1.0.0无README数据
-
> node-sass@3.2.0 install \\ primary \home\mendsley\profile\Desktop\project\\\
ode_modules\gulp- sass\\\
ode_modules\\\
ode-sass
>节点脚本/ install.js

'\\primary\home\mendsley\profile\Desktop\project\\\
ode_modules\gulp- sass\\\
ode_modules\\\
ode- sass'
CMD.EXE以上述路径作为当前目录启动。
不支持UNC路径。默认为Windows目录。
module.js:338
throw err;
^
错误:无法在Function.Module._resolveFilename(module.js:336:15)处找到模块'C:\Windows\scripts\install.js'

在Function.Module._load(module.js:278:25)
在Function.Module.runMain(module.js:501:10)
在启动时(node.js:129:16 )
在node.js:814:3
npm ERR! Windows_NT 6.1.7601
npm ERR! argvc:\\Program Files\\\\\\\\\\\\\\\\\\'\\\\\\\\\\\\\\\\\\\\\\\\\\\ npm\\\\
ode_modules\\\\
pm\\bin\\\\
pm-cli.jsinstallgulp-sass
npm ERR!节点v0.12.1
npm ERR! npm v2.13.1
npm ERR!代码ELIFECYCLE

npm ERR! node-sass@3.2.0安装:`node scripts / install.js`
npm ERR!退出状态1
npm ERR!
npm ERR!在node-sass@3.2.0安装脚本'node scripts / install.js'失败。
npm ERR!这很可能是node-sass软件包
npm ERR!的问题!而不是npm本身。
npm ERR!告诉作者这在你的系统上失败了:
npm ERR!节点脚本/ install.js
npm ERR!您可以通过以下方式获得他们的信息:
npm ERR! npm owner ls node-sass
npm ERR!上面可能还有其他日志记录输出。

npm ERR!请包含以下任何支持请求的文件:
npm ERR! \\\\\\ primary \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ b $ b

我正在我的工作电脑上试用此功能,所以我不确定这是否重要。系统管理员表示不应该有任何问题,并且其他人对于相同的软件包没有问题......并且与他们交谈,他们没有提供任何帮助。我试过我的个人笔记本电脑上的所有东西,并且 gulp-sass 安装的很好,所以它是我工作电脑的东西。



我最初的想法是这是一个路径问题,但为什么其他软件包安装还好?



我没有卸载/重新安装Nodejs,但这并没有帮助。 / p>

有没有人有想法?

预先感谢!

解决方案

你的第一个猜测是好的,因为它是路径名的问题。从错误消息:


UNC路径不受支持。默认为Windows目录。


需要访问 \\primary\home\mendsley\\ \\ ... \\\
ode_modules\\\
ode-sass
以执行gulp-sass安装脚本。但是这个路径是一个UNC路径,因此不支持。



因此,npm命令默认为 C:/ Windows ,并尝试执行gulp-sass(install.js)的安装脚本,但您可能会猜到,此脚本不在此目录中。


I'm trying to learn how to use gulp / sass / and all the other fun tools with Nodejs and I'm having an issue installing gulp-sass. The process I'm using to install everything is:

1.  Start Git Bash in the project folder
2.  npm init
3.  npm install gulp -g
4.  npm install gulp --save-dev
5.  npm install gulp-sass <- this is where I get errors

Once I get to step five, I get the following error:

$ npm install gulp-sass
npm WARN package.json project@1.0.0 No repository field.
npm WARN package.json project@1.0.0 No README data
-
> node-sass@3.2.0 install     \\primary\home\mendsley\profile\Desktop\project\node_modules\gulp-  sass\node_modules\node-sass
> node scripts/install.js

'\\primary\home\mendsley\profile\Desktop\project\node_modules\gulp-   sass\node_modules\node-sass'
CMD.EXE was started with the above path as the current directory.
UNC paths are not supported.  Defaulting to Windows directory.
module.js:338
throw err;
      ^
Error: Cannot find module 'C:\Windows\scripts\install.js'
at Function.Module._resolveFilename (module.js:336:15)
at Function.Module._load (module.js:278:25)
at Function.Module.runMain (module.js:501:10)
at startup (node.js:129:16)
at node.js:814:3
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "c:\\Program Files\\nodejs\\node.exe"     "c:\\Users\\mendsley\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js"     "install" "gulp-sass"
npm ERR! node v0.12.1
npm ERR! npm  v2.13.1
npm ERR! code ELIFECYCLE

npm ERR! node-sass@3.2.0 install: `node scripts/install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass@3.2.0 install script 'node scripts/install.js'.
npm ERR! This is most likely a problem with the node-sass package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node scripts/install.js
npm ERR! You can get their info via:
npm ERR!     npm owner ls node-sass
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     \\primary\home\mendsley\profile\Desktop\project\npm-debug.log

I'm trying this on my work computer, so I'm not sure if that matters. The system admin says there should not be any issue and other people have no issue with same package...and talking to them, they offer no help. I tried everything on my personal laptop and gulp-sass installs just fine, so it is something with my work pc.

My initial thought is it's a path issue, but then why do other packages install okay?

I did uninstall/reinstall Nodejs, but that didn't help.

Does anyone have an idea?

Thanks in advance!

解决方案

Your first guess was good as it is a matter of path name. From the error message :

UNC paths are not supported. Defaulting to Windows directory.

Npm needed to access \\primary\home\mendsley\...\node_modules\node-sass so as to execute the gulp-sass installation script. But this path is a UNC path (Uniform Naming Convention) and therefore is not supported.

As a consequence, the npm command defaulted to C:/Windows instead and tries to execute the installation script of gulp-sass (install.js) but this script is, as you might guess, not present in this directory.

这篇关于无法安装gulp-sass的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆