License failed,exit(1) Program! errorCode:6什么意思

订阅你的位置: >
> 【记录】为Python安装MySQL数据库模块:MySQLdb
背景折腾:的过程中,需要去安装MySQLdb。下载MySQLdb去官网:看到有1.2.4和1.2.3所以去最新的1.2.4:下载对应的编译好的版本:得到1MB的MySQL-python-1.2.4.win32-py2.7.exe安装MySQLdb双击安装:结果出错:看来此x86的exe,是不支持我的win7 x64。所以只能去下载源码再去安装了。下载源码:然后再去解压和安装,结果果然出现error: Unable to find vcvarsall.bat的错误:D:\tmp\dev_tools\python\mysql\MySQL-python-1.2.4\MySQL-python-1.2.4&setup.py install           Downloading              Extracting in c:\users\cli\appdata\local\temp\tmpkapo0l             Now working in c:\users\cli\appdata\local\temp\tmpkapo0l\distribute-0.6.28             Building a Distribute egg in D:\tmp\dev_tools\python\mysql\MySQL-python-1.2.4\MySQL-python-1.2.4             D:\tmp\dev_tools\python\mysql\MySQL-python-1.2.4\MySQL-python-1.2.4\distribute-0.6.28-py2.7.egg             running install             running bdist_egg             running egg_info             writing MySQL_python.egg-info\PKG-INFO             writing top-level names to MySQL_python.egg-info\top_level.txt             writing dependency_links to MySQL_python.egg-info\dependency_links.txt             writing MySQL_python.egg-info\PKG-INFO             writing top-level names to MySQL_python.egg-info\top_level.txt             writing dependency_links to MySQL_python.egg-info\dependency_links.txt             reading manifest file ‘MySQL_python.egg-info\SOURCES.txt’             reading manifest template ‘MANIFEST.in’             writing manifest file ‘MySQL_python.egg-info\SOURCES.txt’             installing library code to build\bdist.win-amd64\egg             running install_lib             running build_py             creating build             creating build\lib.win-amd64-2.7             copying _mysql_exceptions.py -& build\lib.win-amd64-2.7             creating build\lib.win-amd64-2.7\MySQLdb             copying MySQLdb\__init__.py -& build\lib.win-amd64-2.7\MySQLdb             copying MySQLdb\converters.py -& build\lib.win-amd64-2.7\MySQLdb             copying MySQLdb\connections.py -& build\lib.win-amd64-2.7\MySQLdb             copying MySQLdb\cursors.py -& build\lib.win-amd64-2.7\MySQLdb             copying MySQLdb\release.py -& build\lib.win-amd64-2.7\MySQLdb             copying MySQLdb\times.py -& build\lib.win-amd64-2.7\MySQLdb             creating build\lib.win-amd64-2.7\MySQLdb\constants             copying MySQLdb\constants\__init__.py -& build\lib.win-amd64-2.7\MySQLdb\constants             copying MySQLdb\constants\CR.py -& build\lib.win-amd64-2.7\MySQLdb\constants             copying MySQLdb\constants\FIELD_TYPE.py -& build\lib.win-amd64-2.7\MySQLdb\constants             copying MySQLdb\constants\ER.py -& build\lib.win-amd64-2.7\MySQLdb\constants             copying MySQLdb\constants\FLAG.py -& build\lib.win-amd64-2.7\MySQLdb\constants             copying MySQLdb\constants\REFRESH.py -& build\lib.win-amd64-2.7\MySQLdb\constants             copying MySQLdb\constants\CLIENT.py -& build\lib.win-amd64-2.7\MySQLdb\constants             running build_ext             building ‘_mysql’ extension             error: Unable to find vcvarsall.batD:\tmp\dev_tools\python\mysql\MySQL-python-1.2.4\MySQL-python-1.2.4&然后参考之前的办法,结果还是出错:D:\tmp\dev_tools\python\mysql\MySQL-python-1.2.4\MySQL-python-1.2.4&SET VS90COMNTOOLS=%VS100COMNTOOLS%D:\tmp\dev_tools\python\mysql\MySQL-python-1.2.4\MySQL-python-1.2.4&setup.py install           running install             running bdist_egg             running egg_info             writing MySQL_python.egg-info\PKG-INFO             writing top-level names to MySQL_python.egg-info\top_level.txt             writing dependency_links to MySQL_python.egg-info\dependency_links.txt             writing MySQL_python.egg-info\PKG-INFO             writing top-level names to MySQL_python.egg-info\top_level.txt             writing dependency_links to MySQL_python.egg-info\dependency_links.txt             reading manifest file ‘MySQL_python.egg-info\SOURCES.txt’             reading manifest template ‘MANIFEST.in’             writing manifest file ‘MySQL_python.egg-info\SOURCES.txt’             installing library code to build\bdist.win-amd64\egg             running install_lib             running build_py             copying MySQLdb\release.py -& build\lib.win-amd64-2.7\MySQLdb             running build_ext             building ‘_mysql’ extension             creating build\temp.win-amd64-2.7             creating build\temp.win-amd64-2.7\Release             C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -Dversion_info=(1,2,4,’final’,1) -D__version__=1.2.4 &-IC:\Program Files (x86)\MySQL\MySQL             Connector C 6.0.2\include& -ID:\tmp\dev_install_root\Python27_x64\include -ID:\tmp\dev_install_root\Python27_x64\PC /Tc_mysql.c /Fobuild\temp.win-amd64-2.7\Release\_mysql.obj /Zl             _mysql.c             _mysql.c(42) : fatal error C1083: Cannot open include file: ‘config-win.h’: No such file or directory             error: command ‘&C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\amd64\cl.exe&’ failed with exit status 2D:\tmp\dev_tools\python\mysql\MySQL-python-1.2.4\MySQL-python-1.2.4&         然后再参考:所说的:1)问题 : _mysql.c(34) : fatal error C1083: Cannot open include file: ‘config-win.h’: No such file or directory       error: command ‘”C:/Program Files/Microsoft Visual Studio 9.0/VC/BIN/cl.exe”‘ failed with exit status 2原因 :原因是安装MySQL的时候没有安装C语言库。解决 :重新运行MySQL的安装程序,选择Modify,把“C Include Files / Lib Files”勾选上,并安装。去重新安装mysql。  继续:的折腾:1.参考:得知:python的此处的要安装x64还是x86,是取决于你所安装的Python的版本,而不是OS的版本。所以此处去x64 win7中的cmd中确认一下python的版本:C:\Users\CLi&python Python 2.7.3 (default, Apr 10 :47) [MSC v.1500 64 bit (AMD64)] on win32 Type &help&, &copyright&, &credits& or &license& for more information. &&&的确是x64的,所以的确要安装的是x64。2.下载对应的: (1.0 MiB)结果链接失效:“File does not exist.”3.从:找到一堆的下载,但是结果都失效了。4.参考:结果最后找到的下载地址也是上面的那个失效的地址。5.还是参考:和去自己编译吧。6.然后还是同样错误:D:\tmp\dev_tools\python\mysql\MySQL-python-1.2.4\MySQL-python-1.2.4&SET VS90COMNTOOLS=%VS100COMNTOOLS%D:\tmp\dev_tools\python\mysql\MySQL-python-1.2.4\MySQL-python-1.2.4&setup.py install running install running bdist_egg running egg_info writing MySQL_python.egg-info\PKG-INFO writing top-level names to MySQL_python.egg-info\top_level.txt writing dependency_links to MySQL_python.egg-info\dependency_links.txt writing MySQL_python.egg-info\PKG-INFO writing top-level names to MySQL_python.egg-info\top_level.txt writing dependency_links to MySQL_python.egg-info\dependency_links.txt reading manifest file ‘MySQL_python.egg-info\SOURCES.txt’ reading manifest template ‘MANIFEST.in’ writing manifest file ‘MySQL_python.egg-info\SOURCES.txt’ installing library code to build\bdist.win-amd64\egg running install_lib running build_py copying MySQLdb\release.py -& build\lib.win-amd64-2.7\MySQLdb running build_ext building ‘_mysql’ extension C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -Dversion_info=(1,2,4,’final’,1) -D__version__=1.2.4 &-IC:\Program File s (x86)\MySQL\MySQL Connector C 6.0.2\include& -ID:\tmp\dev_install_root\Python27_x64\include -ID:\tmp\dev_install_root\Python27_x64\PC /Tc_mysql.c /Fobuild\temp.win-amd64-2.7\Rele ase\_mysql.obj /Zl _mysql.c _mysql.c(42) : fatal error C1083: Cannot open include file: ‘config-win.h’: No such file or directory error: command ‘&C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\amd64\cl.exe&’ failed with exit status 2然后参考:看到了site.cfg内容是:[options]
# embedded: link against the embedded server library
# threadsafe: use the threadsafe client
# static: link against a static library (probably required for embedded)
embedded = False
threadsafe = True
static = False
# The path to mysql_config.
# Only use this if mysql_config is not on your PATH, or you have some weird
# setup that requires it.
#mysql_config = /usr/local/bin/mysql_config
# http://stackoverflow.com/questions/1972259/mysql-python-install-problem-using-virtualenv-windows-pip
# Windows connector libs for MySQL. You need a 32-bit connector for your 32-bit Python build.
connector = C:\Program Files (x86)\MySQL\MySQL Connector C 6.0.2然后注意到了,上面的编译过程中的include的路径,就是此处的connector的值。7.又在这里:找到了一个已编译的版本的下载地址: [1.1 Mb] [Python 2.7] [64 bit] [JUN 08, 2011]然后去安装:然后就可以写代码去测试是否工作了。在Python中使用MySQLdb操作MySQL数据库参考:然后用:#!/usr/bin/python
# -*- coding: utf-8 -*-
-------------------------------------------------------------------------------
【记录】为Python安装MySQL数据库模块:MySQLdb
https://www.crifan.com/python_install_module_mysql_mysqldb/
-------------------------------------------------------------------------------
#---------------------------------import---------------------------------------
import MySQLdb
def python_mysql_test():
try to use mysql in python
conn=MySQLdb.connect(host='localhost',user='root',passwd='xxx',db='wordpress',port=3306)
print &conn=&,
cur=conn.cursor()
print &cur=&,
cur.execute('select * from wp_users')
cur.close()
conn.close()
except MySQLdb.Error,e:
print &Mysql Error %d: %s& % (e.args[0], e.args[1])
###############################################################################
if __name__==&__main__&:
python_mysql_test();可以显示连接成功了:D:\tmp\tmp_dev_root\python\tutorial_summary\python_mysql_test&python_mysql_test.py conn= &_mysql.connection open to ‘localhost’ at 2a46ad8&cur= &MySQLdb.cursors.Cursor object at 0xA54C50&对应的wordpress的数据库是:9.再去折腾新建数据项试试:#!/usr/bin/python
# -*- coding: utf-8 -*-
-------------------------------------------------------------------------------
【记录】为Python安装MySQL数据库模块:MySQLdb
https://www.crifan.com/python_install_module_mysql_mysqldb/
-------------------------------------------------------------------------------
#---------------------------------import---------------------------------------
import MySQLdb
def python_mysql_test():
try to use mysql in python
conn=MySQLdb.connect(host='localhost',user='root',passwd='xxx',db='test',port=3306, charset='utf8')
print &conn=&,
cur=conn.cursor()
print &cur=&,
createdDb = cur.execute('create database if not exists pythonMysql')
print &createdDb=&,createdDb;
selectedDb = conn.select_db('pythonMysql')
print &selectedDb=&,selectedDb;
createdTable = cur.execute('create table test(id int,info varchar(20))')
print &createdTable=&,createdT
value=[1,'hi rollen']
insertedValue = cur.execute('insert into test values(%s,%s)',value)
print &insertedValue=&,insertedV
for i in range(20):
values.append((i,'hi rollen'+str(i)))
insertedValues = cur.executemany('insert into test values(%s,%s)',values)
print &insertedValues=&,insertedV
updatedInfo = cur.execute('update test set info=&I am rollen& where id=3')
print &updatedInfo=&,updatedI
committed = conn.commit()
print &committed=&,
closedCur = cur.close()
print &closedCur=&,closedC
closedConn = conn.close()
print &closedConn=&,closedC
except MySQLdb.Error,e:
print &Mysql Error %d: %s& % (e.args[0], e.args[1])
###############################################################################
if __name__==&__main__&:
python_mysql_test();结果如下:D:\tmp\tmp_dev_root\python\tutorial_summary\python_mysql_test&python_mysql_test.py conn= &_mysql.connection open to ‘localhost’ at 2a46ad8&cur= &MySQLdb.cursors.Cursor object at 0xA54C50&D:\tmp\tmp_dev_root\python\tutorial_summary\python_mysql_test&python_mysql_test.py conn= &_mysql.connection open to ‘localhost’ at 2be06a8&cur= &MySQLdb.cursors.Cursor object at 0xB7BE0&createdDb= 1selectedDb= NonecreatedTable= 0insertedValue= 1insertedValues= 20updatedInfo= 1committed= NoneclosedCur= NoneclosedConn= None数据库中去看看结果:都是可以正常工作的。至此,简单的操作,到此结束。以后就是针对要操作的数据,如何导入数据库,如何操作数据库了。 【总结】安装好PythonMQL后,参考了别人的示例代码,剩下的,就是以后遇到要保存的数据,去保存操作数据库的事情了。需要后续好好学习mysql如何操作的。转载请注明: & 与本文相关的文章
13 queries in 0.368 seconds, using 10.50MB memory求大神Help,执行node-gyp configure报错 - CNode技术社区
编程不仅仅是一门技术,更是一门艺术!
最近开始研究nodejs,想用nodejs做web,测试系统是win7,打算数据库用sqlserver,然后在网上搜索了下nodejs支持sqlserver 包的安装过程,执行到这一步就的时候就跪了。(感觉好麻烦,为了支持sqlserver 各种安装程序,执行命令,各种报错。这还怎么玩)
网上的步骤:
1.安装Node.js(官网上下载)
2.安装node-gyp(安装好node.js后进入到npm目录,执行npm install node-gyp)
3.安装python 2.7.x(WWW.PYTHON.ORG上可以下载,注意下载2.7.X版本)
4.安装Visual C++ 2010 (vs2010中必须有C++模块,也可以单独下载Microsoft)
5.安装SQL Server Native Client 11.0(
这些全部安装好后,就搭建好了生成msnodesql模块的环境,现在可以去官网的module上下载msnodesql模块了(注意利用npm intsall msnodesql也可以安装,但是我是win7 64执行这么命令总是不能正确安装,所以我手动下载了),下载时注意msnodesql的版本和node.js的版本对应。将下载好的msnodesql文件夹复制到node.js的node_modules路径下,然后生成步骤如下:
1.node-gyp configure (到这一步就跪了)
2.node-gyp build 或node-gyp build --debug(前者是release版)
C:\Users\John&node-gyp configure
gyp info it worked if it ends with ok
gyp info using node-gyp[@1](/user/1).0.2
gyp info using node[@0](/user/0).10.31 | win32 | x64
gyp info spawn python
gyp info spawn args [ 'C:\\Users\\John\\AppData\\Roaming\\npm\\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
'C:\\Users\\John\\build\\config.gypi',
gyp info spawn args
'-I',
gyp info spawn args
'C:\\Users\\John\\AppData\\Roaming\\npm\\node_modules\\node-gyp\\addon.gypi',
gyp info spawn args
'-I',
gyp info spawn args
'C:\\Users\\John\\.node-gyp\\0.10.31\\common.gypi',
gyp info spawn args
'-Dlibrary=shared_library',
gyp info spawn args
'-Dvisibility=default',
gyp info spawn args
'-Dnode_root_dir=C:\\Users\\John\\.node-gyp\\0.10.31',
gyp info spawn args
'-Dmodule_root_dir=C:\\Users\\John',
gyp info spawn args
'--depth=.',
gyp info spawn args
'--no-parallel',
gyp info spawn args
'--generator-output',
gyp info spawn args
'C:\\Users\\John\\build',
gyp info spawn args
'-Goutput_dir=.' ]
gyp: binding.gyp not found (cwd: C:\Users\John) while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack
at ChildProcess.onCpExit (C:\Users\John\AppData\Roaming\npm\node_modules\node-gyp\lib\configure.js:343:16)
gyp ERR! stack
at ChildProcess.emit (events.js:98:17)
gyp ERR! stack
at Process.ChildProcess._handle.onexit (child_process.js:810:12)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command &node& &C:\\Users\\John\\AppData\\Roaming\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js& &configure&
gyp ERR! cwd C:\Users\John
gyp ERR! node -v v0.10.31
gyp ERR! node-gyp -v v1.0.2
gyp ERR! not ok
C:\Users\John&npm install node-sqlserver
npm WARN deprecated node-sqlserver[@0](/user/0).1.0: This package has been superseded by msnodesql.
npm WARN engine node-sqlserver[@0](/user/0).1.0: wanted: {&node&:&0.6&} (current: {&node&:&0.10.31&,&npm&:&1.4.23&})
& node-sqlserver[@0](/user/0).1.0 install C:\Users\John\node_modules\node-sqlserver
& node-gyp rebuild
C:\Users\John\node_modules\node-sqlserver&node &D:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js& rebuild
在此解决方案中一次生成一个项目。若要启用并行生成,请添加“/m”开关。
Connection.cpp
OdbcConnection.cpp
E:\Program Files\Microsoft Visual Studio 10.0\VC\include\xlocale(323): warning C4530: 使用了 C++ 异常处理程序,但未启用展开语义。请指定 /EHsc [C:\Users\John\node_modules\node-sqlserver\build\sqlserver.vcxproj]
E:\Program Files\Microsoft Visual Studio 10.0\VC\include\xlocale(323): warning C4530: 使用了 C++ 异常处理程序,但未启用展开语义。请指定 /EHsc [C:\Users\John\node_modules\node-sqlserver\build\sqlserver.vcxproj]
c:\users\john\node_modules\node-sqlserver\src\Column.h(40): warning C4267: “参数”: 从“size_t”转换到“int”,可能丢失数据 [C:\Users\John\node_modules\node-sqlserver\build\sqlserver.vcxproj]
c:\users\john\node_modules\node-sqlserver\src\Column.h(64): warning C4267: “初始化”: 从“size_t”转换到“int”,可能丢失数据 [C:\Users\John\node_modules\node-sqlserver\build\sqlserver.vcxproj]
c:\users\john\node_modules\node-sqlserver\src\ResultSet.h(51): warning C4267: “return”: 从“size_t”转换到“int”,可能丢失数据 [C:\Users\John\node_modules\node-sqlserver\build\sqlserver.vcxproj]
..\src\OdbcConnection.cpp(82): warning C4267: “参数”: 从“size_t”转换到“SQLSMALLINT”,可能丢失数据 [C:\Users\John\node_modules\node-sqlserver\build\sqlserver.vcxproj]
..\src\OdbcConnection.cpp(118): warning C4267: “参数”: 从“size_t”转换到“SQLINTEGER”,可能丢失数据 [C:\Users\John\node_modules\node-sqlserver\build\sqlserver.vcxproj]
..\src\OdbcConnection.cpp(384): warning C4244: “初始化”: 从“SQLLEN”转换到“int”,可能丢失数据 [C:\Users\John\node_modules\node-sqlserver\build\sqlserver.vcxproj]
..\src\OdbcConnection.cpp(386): warning C4267: “=”: 从“size_t”转换到“int”,可能丢失数据 [C:\Users\John\node_modules\node-sqlserver\build\sqlserver.vcxproj]
c:\users\john\node_modules\node-sqlserver\src\Operation.h(36): error C2664: “uv_queue_work”: 不能将参数 4 从“void (__cdecl *)(uv_work_t *)”转换为“uv_after_work_cb” [C:\Users\John\node_modules\node-sqlserver\build\s
qlserver.vcxpr
在匹配目标类型的范围内没有具有该名称的函数
c:\users\john\node_modules\node-sqlserver\src\Column.h(40): warning C4267: “参数”: 从“size_t”转换到“int”,可能丢失数据 [C:\Users\John\node_modules\node-sqlserver\build\sqlserver.vcxproj]
c:\users\john\node_modules\node-sqlserver\src\Column.h(64): warning C4267: “初始化”: 从“size_t”转换到“int”,可能丢失数据 [C:\Users\John\node_modules\node-sqlserver\build\sqlserver.vcxproj]
c:\users\john\node_modules\node-sqlserver\src\ResultSet.h(51): warning C4267: “return”: 从“size_t”转换到“int”,可能丢失数据 [C:\Users\John\node_modules\node-sqlserver\build\sqlserver.vcxproj]
OdbcException.cpp
E:\Program Files\Microsoft Visual Studio 10.0\VC\include\xmemory(201): warning C4506: 内联函数“v8::Persistent&T& v8::Persistent&T&::New(v8::Handle&T&)”没有定义 [C:\Users\John\node_modules\node-sqlserver\build\sqlserver
T=v8::Object
OdbcOperation.cpp
E:\Program Files\Microsoft Visual Studio 10.0\VC\include\xlocale(323): warning C4530: 使用了 C++ 异常处理程序,但未启用展开语义。请指定 /EHsc [C:\Users\John\node_modules\node-sqlserver\build\sqlserver.vcxproj]
E:\Program Files\Microsoft Visual Studio 10.0\VC\include\xlocale(323): warning C4530: 使用了 C++ 异常处理程序,但未启用展开语义。请指定 /EHsc [C:\Users\John\node_modules\node-sqlserver\build\sqlserver.vcxproj]
c:\users\john\node_modules\node-sqlserver\src\Operation.h(36): error C2664: “uv_queue_work”: 不能将参数 4 从“void (__cdecl *)(uv_work_t *)”转换为“uv_after_work_cb” [C:\Users\John\node_modules\node-sqlserver\build\s
qlserver.vcxpr
在匹配目标类型的范围内没有具有该名称的函数
c:\users\john\node_modules\node-sqlserver\src\Column.h(40): warning C4267: “参数”: 从“size_t”转换到“int”,可能丢失数据 [C:\Users\John\node_modules\node-sqlserver\build\sqlserver.vcxproj]
c:\users\john\node_modules\node-sqlserver\src\Column.h(64): warning C4267: “初始化”: 从“size_t”转换到“int”,可能丢失数据 [C:\Users\John\node_modules\node-sqlserver\build\sqlserver.vcxproj]
c:\users\john\node_modules\node-sqlserver\src\ResultSet.h(51): warning C4267: “return”: 从“size_t”转换到“int”,可能丢失数据 [C:\Users\John\node_modules\node-sqlserver\build\sqlserver.vcxproj]
ResultSet.cpp
E:\Program Files\Microsoft Visual Studio 10.0\VC\include\xstring(817): warning C4506: 内联函数“v8::Persistent&T& v8::Persistent&T&::New(v8::Handle&T&)”没有定义 [C:\Users\John\node_modules\node-sqlserver\build\sqlserver
T=v8::Object
stdafx.cpp
E:\Program Files\Microsoft Visual Studio 10.0\VC\include\xlocale(323): warning C4530: 使用了 C++ 异常处理程序,但未启用展开语义。请指定 /EHsc [C:\Users\John\node_modules\node-sqlserver\build\sqlserver.vcxproj]
c:\users\john\node_modules\node-sqlserver\src\Column.h(40): warning C4267: “参数”: 从“size_t”转换到“int”,可能丢失数据 [C:\Users\John\node_modules\node-sqlserver\build\sqlserver.vcxproj]
c:\users\john\node_modules\node-sqlserver\src\Column.h(64): warning C4267: “初始化”: 从“size_t”转换到“int”,可能丢失数据 [C:\Users\John\node_modules\node-sqlserver\build\sqlserver.vcxproj]
E:\Program Files\Microsoft Visual Studio 10.0\VC\include\xlocale(323): warning C4530: 使用了 C++ 异常处理程序,但未启用展开语义。请指定 /EHsc [C:\Users\John\node_modules\node-sqlserver\build\sqlserver.vcxproj]
c:\users\john\node_modules\node-sqlserver\src\ResultSet.h(51): warning C4267: “return”: 从“size_t”转换到“int”,可能丢失数据 [C:\Users\John\node_modules\node-sqlserver\build\sqlserver.vcxproj]
..\src\ResultSet.cpp(72): warning C4244: “参数”: 从“const SQLULEN”转换到“int32_t”,可能丢失数据 [C:\Users\John\node_modules\node-sqlserver\build\sqlserver.vcxproj]
..\src\ResultSet.cpp(72): warning C4244: “参数”: 从“const SQLULEN”转换到“int32_t”,可能丢失数据 [C:\Users\John\node_modules\node-sqlserver\build\sqlserver.vcxproj]
E:\Program Files\Microsoft Visual Studio 10.0\VC\include\xmemory(201): warning C4506: 内联函数“v8::Persistent&T& v8::Persistent&T&::New(v8::Handle&T&)”没有定义 [C:\Users\John\node_modules\node-sqlserver\build\sqlserver
T=v8::Object
Utility.cpp
C:\Users\John\.node-gyp\0.10.31\deps\v8\include\v8.h(179): warning C4506: 内联函数“v8::Persistent&T& v8::Persistent&T&::New(v8::Handle&T&)”没有定义 [C:\Users\John\node_modules\node-sqlserver\build\sqlserver.vcxproj]
T=v8::Object
E:\Program Files\Microsoft Visual Studio 10.0\VC\include\xlocale(323): warning C4530: 使用了 C++ 异常处理程序,但未启用展开语义。请指定 /EHsc [C:\Users\John\node_modules\node-sqlserver\build\sqlserver.vcxproj]
..\src\Utility.cpp(55): warning C4267: “参数”: 从“size_t”转换到“int”,可能丢失数据 [C:\Users\John\node_modules\node-sqlserver\build\sqlserver.vcxproj]
C:\Users\John\.node-gyp\0.10.31\deps\v8\include\v8.h(179): warning C4506: 内联函数“v8::Persistent&T& v8::Persistent&T&::New(v8::Handle&T&)”没有定义 [C:\Users\John\node_modules\node-sqlserver\build\sqlserver.vcxproj]
T=v8::Object
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 (D:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:267:23)
gyp ERR! stack
at ChildProcess.emit (events.js:98:17)
gyp ERR! stack
at Process.ChildProcess._handle.onexit (child_process.js:810:12)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command &node& &D:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js& &rebuild&
gyp ERR! cwd C:\Users\John\node_modules\node-sqlserver
gyp ERR! node -v v0.10.31
gyp ERR! node-gyp -v v1.0.1
gyp ERR! not ok
npm ERR! node-sqlserver[@0](/user/0).1.0 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! Failed at the node-sqlserver[@0](/user/0).1.0 install script.
npm ERR! This is most likely a problem with the node-sqlserver package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
node-gyp rebuild
npm ERR! You can get their info via:
npm owner ls node-sqlserver
npm ERR! There is likely additional logging output above.
npm ERR! System Windows_NT 6.1.7601
npm ERR! command &D:\\Program Files\\nodejs\\\\node.exe& &D:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js& &install& &node-sqlserver&
npm ERR! cwd C:\Users\John
npm ERR! node -v v0.10.31
npm ERR! npm -v 1.4.23
npm ERR! code ELIFECYCLE
npm ERR! Additional logging details can be found in:
C:\Users\John\npm-debug.log
npm ERR! not ok code 0
C:\Users\John&
还有这个错误
楼主,请问你node-gyp configure报错解决了吗?
遇到同样问题快要奔溃,终于解决
首先删除 $HOME/.node-gyp
rm -rf ~/.node-gyp
然后重新安装最新的 node-gyp 包
npm i node-gyp -g
然后移除直接安装但build失败的 nodemodules
rm -rf ./project/node_modules
最后重新 npm i -d 就行
最初解决方案出自:
CNode 社区为国内最专业的 Node.js 开源技术社区,致力于 Node.js 的技术研究。
服务器赞助商为
,存储赞助商为
,由提供应用性能服务。
新手搭建 Node.js 服务器,推荐使用无需备案的}

我要回帖

更多关于 c语言exit 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信