今天通过npm 安装 install 的时候出现的问题
E:\Workspace_WebStorm\angular2>npm install -g
C:\Users\lyx\AppData\Roaming\npm
`-- angular2@0.0.0
`-- UNMET PEER DEPENDENCY typescript@>=1.8.0 <2.1.0 || >=1.9.0-dev || >=2.0.0-dev || || >=2.1.0-dev
npm WARN ts-helpers@1.1.2 requires a peer of typescript@>=1.8.0 <2.1.0 || >=1.9.0-dev || >=2.0.0-dev || || >=2.1.0-dev but none was installed.
E:\Workspace_WebStorm\angular2>npm install
npm WARN deprecated angular-cli@1.0.0-beta.28.3: angular-cli has been renamed to @angular/cli. Please update your dependencies.
> node-sass@4.5.0 install E:\Workspace_WebStorm\angular2\node_modules\angular-cli\node_modules\node-sass
> node scripts/install.js
Downloading binary from https://github.com/sass/node-sass/releases/download/v4.5.0/win32-x64-51_binding.node
Cannot download "https://github.com/sass/node-sass/releases/download/v4.5.0/win32-x64-51_binding.node":
ESOCKETTIMEDOUT
Hint: If github.com is not accessible in your location
try setting a proxy via HTTP_PROXY, e.g.
export HTTP_PROXY=http://example.com:1234
or configure npm proxy via
npm config set proxy http://example.com:8080
> node-sass@4.5.0 postinstall E:\Workspace_WebStorm\angular2\node_modules\angular-cli\node_modules\node-sass
> node scripts/build.js
Binary found at E:\Workspace_WebStorm\angular2\node_modules\angular-cli\node_modules\node-sass\vendor\win32-x64-51\binding.node
Testing binary
Binary has a problem: Error: %1 is not a valid Win32 application.
\\?\E:\Workspace_WebStorm\angular2\node_modules\angular-cli\node_modules\node-sass\vendor\win32-x64-51\binding.node
at Object.Module._extensions..node (module.js:598:18)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Module.require (module.js:498:17)
at require (internal/module.js:20:19)
at module.exports (E:\Workspace_WebStorm\angular2\node_modules\angular-cli\node_modules\node-sass\lib\binding.js:19:10)
at Object.<anonymous> (E:\Workspace_WebStorm\angular2\node_modules\angular-cli\node_modules\node-sass\lib\index.js:14:35)
at Module._compile (module.js:571:32)
at Object.Module._extensions..js (module.js:580:10)
Building the binary locally
Building: E:\node\node.exe E:\Workspace_WebStorm\angular2\node_modules\node-gyp\bin\node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
gyp info it worked if it ends with ok
gyp verb cli [ 'E:\\node\\node.exe',
gyp verb cli 'E:\\Workspace_WebStorm\\angular2\\node_modules\\node-gyp\\bin\\node-gyp.js',
gyp verb cli 'rebuild',
gyp verb cli '--verbose',
gyp verb cli '--libsass_ext=',
gyp verb cli '--libsass_cflags=',
gyp verb cli '--libsass_ldflags=',
gyp verb cli '--libsass_library=' ]
gyp info using node-gyp@3.5.0
gyp info using node@7.5.0 | win32 | x64
gyp verb command rebuild []
gyp verb command clean []
gyp verb clean removing "build" directory
gyp verb command configure []
gyp verb check python checking for Python executable "python2" in the PATH
gyp verb `which` failed Error: not found: python2
gyp verb `which` failed at getNotFoundError (E:\Workspace_WebStorm\angular2\node_modules\which\which.js:13:12)
gyp verb `which` failed at F (E:\Workspace_WebStorm\angular2\node_modules\which\which.js:68:19)
gyp verb `which` failed at E (E:\Workspace_WebStorm\angular2\node_modules\which\which.js:80:29)
gyp verb `which` failed at E:\Workspace_WebStorm\angular2\node_modules\which\which.js:89:16
gyp verb `which` failed at E:\Workspace_WebStorm\angular2\node_modules\isexe\index.js:44:5
gyp verb `which` failed at E:\Workspace_WebStorm\angular2\node_modules\isexe\windows.js:29:5
gyp verb `which` failed at FSReqWrap.oncomplete (fs.js:112:15)
gyp verb `which` failed python2 { Error: not found: python2
gyp verb `which` failed at getNotFoundError (E:\Workspace_WebStorm\angular2\node_modules\which\which.js:13:12)
gyp verb `which` failed at F (E:\Workspace_WebStorm\angular2\node_modules\which\which.js:68:19)
gyp verb `which` failed at E (E:\Workspace_WebStorm\angular2\node_modules\which\which.js:80:29)
gyp verb `which` failed at E:\Workspace_WebStorm\angular2\node_modules\which\which.js:89:16
gyp verb `which` failed at E:\Workspace_WebStorm\angular2\node_modules\isexe\index.js:44:5
gyp verb `which` failed at E:\Workspace_WebStorm\angular2\node_modules\isexe\windows.js:29:5
gyp verb `which` failed at FSReqWrap.oncomplete (fs.js:112:15) code: 'ENOENT' }
gyp verb check python checking for Python executable "python" in the PATH
gyp verb `which` succeeded python C:\Python27\python.EXE
gyp verb check python version `C:\Python27\python.EXE -c "import platform; print(platform.python_version());"` returned: "2.7.13\r\n"
gyp verb get node dir no --target version specified, falling back to host node version: 7.5.0
gyp verb command install [ '7.5.0' ]
gyp verb install input version string "7.5.0"
gyp verb install installing version: 7.5.0
gyp verb install --ensure was passed, so won't reinstall if already installed
gyp verb install version is already installed, need to check "installVersion"
gyp verb got "installVersion" 9
gyp verb needs "installVersion" 9
gyp verb install version is good
gyp verb get node dir target node version installed: 7.5.0
gyp verb build dir attempting to create "build" dir: E:\Workspace_WebStorm\angular2\node_modules\angular-cli\node_modules\node-sass\build
gyp verb build dir "build" dir needed to be created? E:\Workspace_WebStorm\angular2\node_modules\angular-cli\node_modules\node-sass\build
gyp verb build/config.gypi creating config file
gyp verb build/config.gypi writing out config file: E:\Workspace_WebStorm\angular2\node_modules\angular-cli\node_modules\node-sass\build\config.gypi
gyp verb config.gypi checking for gypi file: E:\Workspace_WebStorm\angular2\node_modules\angular-cli\node_modules\node-sass\config.gypi
gyp verb common.gypi checking for gypi file: E:\Workspace_WebStorm\angular2\node_modules\angular-cli\node_modules\node-sass\common.gypi
gyp verb gyp gyp format was not specified; forcing "msvs"
gyp info spawn C:\Python27\python.EXE
gyp info spawn args [ 'E:\\Workspace_WebStorm\\angular2\\node_modules\\node-gyp\\gyp\\gyp_main.py',
gyp info spawn args 'binding.gyp',
gyp info spawn args '-f',
gyp info spawn args 'msvs',
gyp info spawn args '-G',
gyp info spawn args 'msvs_version=auto',
gyp info spawn args '-I',
gyp info spawn args 'E:\\Workspace_WebStorm\\angular2\\node_modules\\angular-cli\\node_modules\\node-sass\\build\\config.gypi',
gyp info spawn args '-I',
gyp info spawn args 'E:\\Workspace_WebStorm\\angular2\\node_modules\\node-gyp\\addon.gypi',
gyp info spawn args '-I',
gyp info spawn args 'C:\\Users\\lyx\\.node-gyp\\7.5.0\\include\\node\\common.gypi',
gyp info spawn args '-Dlibrary=shared_library',
gyp info spawn args '-Dvisibility=default',
gyp info spawn args '-Dnode_root_dir=C:\\Users\\lyx\\.node-gyp\\7.5.0',
gyp info spawn args '-Dnode_gyp_dir=E:\\Workspace_WebStorm\\angular2\\node_modules\\node-gyp',
gyp info spawn args '-Dnode_lib_file=node.lib',
gyp info spawn args '-Dmodule_root_dir=E:\\Workspace_WebStorm\\angular2\\node_modules\\angular-cli\\node_modules\\node-sass',
gyp info spawn args '--depth=.',
gyp info spawn args '--no-parallel',
gyp info spawn args '--generator-output',
gyp info spawn args 'E:\\Workspace_WebStorm\\angular2\\node_modules\\angular-cli\\node_modules\\node-sass\\build',
gyp info spawn args '-Goutput_dir=.' ]
gyp verb command build []
gyp verb build type Release
gyp verb architecture x64
gyp verb node dev dir C:\Users\lyx\.node-gyp\7.5.0
gyp verb found first Solution file build/binding.sln
gyp verb could not find "msbuild.exe" in PATH - finding location in registry
gyp verb "Release" dir needed to be created? null
gyp verb copying "node.lib" for x64 C:\Users\lyx\.node-gyp\7.5.0\Release\node.lib
gyp info spawn C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe
gyp info spawn args [ 'build/binding.sln',
gyp info spawn args '/nologo',
gyp info spawn args '/p:Configuration=Release;Platform=x64' ]
在此解决方案中一次生成一个项目。若要启用并行生成,请添加“/m”开关。
生成启动时间为 2017/2/26 16:01:32。
节点 1 上的项目“E:\Workspace_WebStorm\angular2\node_modules\angular-cli\node_modules\node-sass\build\binding.sln”(默认目标)。
ValidateSolutionConfiguration:
正在生成解决方案配置“Release|x64”。
MSBUILD : error MSB3428: 未能加载 Visual C++ 组件“VCBuild.exe”。要解决此问题,1) 安装 .NET Framework 2.0 SDK;2) 安装 Microsoft Visual Stu
dio 2005;或 3) 如果将该组件安装到了其他位置,请将其位置添加到系统路径中。 [E:\Workspace_WebStorm\angular2\node_modules\angular-cli\node_modules\node-
sass\build\binding.sln]
已完成生成项目“E:\Workspace_WebStorm\angular2\node_modules\angular-cli\node_modules\node-sass\build\binding.sln”(默认 目标)的操作 - 失败
。
生成失败。
“E:\Workspace_WebStorm\angular2\node_modules\angular-cli\node_modules\node-sass\build\binding.sln”(默认目标) (1) ->
(_src_\libsass 目标) ->
MSBUILD : error MSB3428: 未能加载 Visual C++ 组件“VCBuild.exe”。要解决此问题,1) 安装 .NET Framework 2.0 SDK;2) 安 装 Microsoft Visual S
tudio 2005;或 3) 如果将该组件安装到了其他位置,请将其位置添加到系统路径中。 [E:\Workspace_WebStorm\angular2\node_modules\angular-cli\node_modules\nod
e-sass\build\binding.sln]
0 个警告
1 个错误
已用时间 00:00:00.57
gyp ERR! build error
gyp ERR! stack Error: `C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe` failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (E:\Workspace_WebStorm\angular2\node_modules\node-gyp\lib\build.js:276:23)
gyp ERR! stack at emitTwo (events.js:106:13)
gyp ERR! stack at ChildProcess.emit (events.js:192:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
gyp ERR! System Windows_NT 10.0.14393
gyp ERR! command "E:\\node\\node.exe" "E:\\Workspace_WebStorm\\angular2\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd E:\Workspace_WebStorm\angular2\node_modules\angular-cli\node_modules\node-sass
gyp ERR! node -v v7.5.0
gyp ERR! node-gyp -v v3.5.0
gyp ERR! not ok
Build failed with error code: 1
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.1: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN enoent ENOENT: no such file or directory, open 'E:\Workspace_WebStorm\angular2\node_modules\node-sass\package.json'
npm WARN sass-loader@4.1.1 requires a peer of node-sass@^3.4.2 || ^4.0.0 but none was installed.
npm ERR! Windows_NT 10.0.14393
npm ERR! argv "E:\\node\\node.exe" "E:\\node\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! node v7.5.0
npm ERR! npm v4.1.2
npm ERR! code ELIFECYCLE
npm ERR! node-sass@4.5.0 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass@4.5.0 postinstall script 'node scripts/build.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, 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/build.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs node-sass
npm ERR! Or if that isn't available, 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! E:\Workspace_WebStorm\angular2\npm-debug.log
------------------------------------------------------------------------
生成启动时间为 2016/6/27 星期一 11:39:46。
节点 1 上的项目“C:\Users\世民\node_modules\node-sass\build\binding.sln”(默认目标)。
ValidateSolutionConfiguration:
正在生成解决方案配置“Release|x64”。
MSBUILD : error MSB3428: 未能加载 Visual C++ 组件“VCBuild.exe”。要解决此问题,1) 安装 .NET Framework 2.0 SDK;2) 安装 Microsoft Visual Studio 2005;或 3) 如果将该组件安装到了其他位置,请将其位置添加到系统路径
中。 [C:\Users\世民\node_modules\node-sass\build\bindi
ng.sln]
已完成生成项目“C:\Users\世民\node_modules\node-sass\build\binding.sln”(默认目标)的操作 - 失败。 生成失败。 “C:\Users\世民\node_modules\node-sass\build\binding.sln”(默认目标) (1) ->
(_src_\libsass 目标) ->
MSBUILD : error MSB3428: 未能加载 Visual C++ 组件“VCBuild.exe”。要解决此问题,1) 安装 .NET Framework 2.0 SDK;2) 安装 Microsoft Visual Studio 2005;或 3) 如果将该组件安装到了其他位置,请将其位置添加到系统路
径中。 [C:\Users\世民\node_modules\node-sass\build\bin
ding.sln] 0 个警告
1 个错误
然后呢,就一头赛到vc++组件里去,安装各种无用的东西,尝试过各种解决方案,最后实在是没有办法了,就仔细的从头到尾的看错误信息,然后在 node scripts/install.js 之后发现这么一句话
Cannot download "https://github.com/sass/node-sass/releases/download/v3.8.0/win32-x64-46_binding.node":
这句话大家都懂的哈,我就不说了,这里我也不知道为什么会下载失败,因为我的电脑全局代理的,正常的访问任何网站都是无阻碍的,百思不得解,
好吧那我就自己下载吧(为什么自己下载?因为我在google的时候也是发现了写有用的东西,虽然没那么直观哈,但是也给了我很多帮助)
下载完了之后把它注册成全局环境变量,两种方式:
第一种:直接右键我的电脑--》属性--》高级系统设置--》环境变量--》添加
第二种:set XXX=文件路经--》set SASS_BINARY_PATH=F:\lishiming\tools\node-sass\win32-x64-46_binding.node
查看环境是否合适:echo %SASS_BINARY_PATH%
如果打印出来您配置好的文件地址那就ok了,
最后再来试试安装:npm i -g node-sass
参照上面的答案完美解决
今天通过npm 安装 install 的时候出现的问题的更多相关文章
- win7下安装配置nodejs、使用npm安装express
1.下载node http://nodejs.cn/download/ 这里下载自己需要的 我的环境是win764,下载地址是:https://nodejs.org/dist/v6.2.0/win-x ...
- 通过npm安装 Cordova
通过npm安装 Cordova 首先请确保你在本地已经安装了NodeJS(可以调用npm命令), 并且是联网状态的.如果不知道如何安装NodeJS, 请参考 ”四步完成NodeJS安装,配置和测试”. ...
- NPM安装之后CMD中不能使用
NPM安装之后CMD中不能使用 这个情况就是path环境变量没有添加NPM 添加环境变量并重启CMD C:\Users\Mark\AppData\Roaming\npm\ 看看这个文件夹就知道为什么要 ...
- npm 安装 ionic cordova
针对npm安装 ionic 和 cordova 过程很慢,且有些安装文件被墙的问题,使用如下方式解决: 1)安装cnpm npm install -g cnpm 2)然后再使用cnpm 安装 ioni ...
- npm安装插件提示
现在使用node的人群越来越多,咱也不能落后,得跟紧脚步才行. 今天使用 npm 安装插件的时候,出现以下提示,而且,安装程序看着好像终止了.而且,看到一个exit单词,就认为说安装出错了. $ np ...
- node 通过指令创建一个package.json文件及npm安装package.json
描述包的文件是package.json文件. 一个这样的文件,里面的信息还是挺大的.我们可以放弃手动建立.为了练手我们有命令行来建一个这样的包; 完成name,varsion....license项的 ...
- node.js的npm安装
我不打算引进node.js的npm安装,但发现node.js通过管理一些包npm实现,或给一个简短的npm. 1.npm什么 npm是一个node包管理和分发工具,已经成为了非官方的公布 ...
- 关于npm安装全局模块,require时报Error: Cannot find module 'XXX'的解决办法
系统环境:centos 下午使用npm安装"cheerio",想搞爬虫玩玩. npm安装有两种模式: 本地 # npm install cheerio 全局 # npm insta ...
- 利用npm安装/删除/发布/更新/撤销发布包 --社会我npm哥,好用话不多
一.什么是npm? npm是javascript的包管理工具,是前端模块化下的一个标志性产物 简单地地说,就是通过npm下载模块,复用已有的代码,提高工作效率 1.从社区的角度:把针对某一特定 ...
随机推荐
- 别人的Linux私房菜(5)首次CentOS7与帮助等
ctrl alt F1-F6切换终端tty1-6,其中,F1的终端带有用户界面. 在终端登录后,输入startx启动个人图形界面.(启动有一些条件限制,如没有其他的X Window启用,已经安装,并具 ...
- 1024 Palindromic Number int_string转换 大整数相加
A number that will be the same when it is written forwards or backwards is known as a Palindromic Nu ...
- javabean的特点
javabean的三个基础条件 1.拥有私有的属性 2.共有的get,set方法 3.默认的构造方法
- 【repost】javascript:;与javascript:void(0)使用介绍
有时候我们在编写js过程中,需要触发事件而不需要返回值,那么就可能需要这样的写法 最近看了好几个关于<a>标签和javascript:void(0)的帖子,谨记于此,以资查阅. 注:以下代 ...
- Oracle通过序列+触发器实现主键自增
接触oracle没多久,在建表的时候发现还不会如何设置主键自动增长.和mysql的设置为AUTO_INCREMENT属性相比,要复杂很多,所以现在记录起来. 我使用的是序列+触发器的方式. 现在已经创 ...
- Mac 下 Java 多版本切换
Step 1: 安装 jdk1.7 jdk1.8 路径如下: + /Library/Java/JavaVirtualMachines/jdk1.7.0_80.jdk + /Library/Java/J ...
- JavaScript中的定时事件
这两个函数都是在给定的时间之后开始执行的,并不是立即执行. var timeId = window.setTimeout("method()",1000); //定时执行,还可以这 ...
- Android交流会-碎片Fragment,闲聊单位与尺寸
女孩:又周末了哦~ 男孩:那么今日来开个交流会,我们也学一学人家高大尚的大会,自己开一个,广州站,Android开发攻城狮交流会~ 1.Fragment概要: Android从3.0开始引入了Frag ...
- 移动端h5页面的那些坑
最近一直在写移动端页面,由于之前写移动端写的比较少,所以此次踩过许多坑.特此总结一下: 1.<input type='button'>背景色在ios中的兼容性,颜色发白 解决办法:在全局样 ...
- HoloLens开发手记 - 使用HoloLens模拟器 Using HoloLens emulator
首先下载HoloLens模拟器 HoloLens模拟器运行在没有真机的情况下在你的PC上测试应用,属于HoloLens开发工具系列.模拟器使用了Hyper-V虚拟机.通常通过传感器获取的人体和环境输入 ...