Nodejs 安装msnodesql和iroute的错误
Nodejs 安装msnodesql和iroute的错误
安装MSNODESQL的时候碰到一个错误无论如何都没有办法解决,有谁遇到过一样的情况么,
我在安装iroute的时候也碰到这种情况
错误代码如下,
gyp info spawn args ‘/p:Configuration=Release;Platform=x64’ ]
在此解决方案中一次生成一个项目。若要启用并行生成,请添加“/m”开关。
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.Cpp.InvalidPlatform
.Targets(23,7): error MSB8007: 项目“sqlserver.vcxproj”的平台无效。平台为“x64
”。您会看到此消息的可能原因
是,您尝试在没有解决方案文件的情况下生成项目,并且为此项目指定了并不存在的非默认
平台。 [F:\msnodesql\build\sqlserver.vcxpr
oj]
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 (C:\Users\pans\AppData\Roaming\npm\nod
e_modules\node-gyp\lib\build.js:267:23)
gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:789:
gyp ERR! System Windows_NT 6.1.7601 gyp ERR! command “node” “C:\Users\pans\AppData\Roaming\npm\node_modules\n ode-gyp\bin\node-gyp.js” "build" gyp ERR! cwd F:\msnodesql gyp ERR! node -v v0.10.17 gyp ERR! node-gyp -v v0.10.9 gyp ERR! not ok
有谁碰到过么,知道如何解决么?????
Nodejs 安装msnodesql和iroute的错误
问题描述
在安装 msnodesql
和 iroute
时遇到了一些错误,这些错误似乎与编译过程中的一些配置问题有关。
错误代码
错误信息如下:
gyp info spawn args '/p:Configuration=Release;Platform=x64' ]
在此解决方案中一次生成一个项目。若要启用并行生成,请添加“/m”开关。
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.Cpp.InvalidPlatform
.Targets(23,7): error MSB8007: 项目“sqlserver.vcxproj”的平台无效。平台为“x64”。
您会看到此消息的可能原因是,您尝试在没有解决方案文件的情况下生成项目,并且为此项目指定了并不存在的非默认平台。 [F:\msnodesql\build\sqlserver.vcxproj]
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 (C:\Users\pans\AppData\Roaming\npm\node_modules\node-gyp\lib\build.js:267:23)
gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:789:)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "node" "C:\Users\pans\AppData\Roaming\npm\node_modules\node-gyp\bin\node-gyp.js" "build"
gyp ERR! cwd F:\msnodesql
gyp ERR! node -v v0.10.17
gyp ERR! node-gyp -v v0.10.9
gyp ERR! not ok
解决方案
从错误信息来看,问题主要出在 node-gyp
的编译过程中。以下是一些可能的解决方案:
-
确保使用正确的平台: 确保你的 Node.js 版本支持你所使用的平台(例如 x64)。你可以通过以下命令检查 Node.js 版本:
node -v
-
安装必要的构建工具: 确保你已经安装了所有必要的构建工具。你可以通过以下命令安装这些工具:
npm install --global windows-build-tools
-
设置正确的环境变量: 确保你的环境变量中包含了必要的路径。特别是
MSBuild
和.NET Framework
的路径。 -
使用最新版本的
node-gyp
: 更新node-gyp
到最新版本,这可能会修复一些已知的问题:npm install -g node-gyp
-
手动安装
msnodesql
和iroute
: 如果上述方法都无效,可以尝试手动安装msnodesql
和iroute
:npm install msnodesql npm install iroute
示例代码
如果你仍然遇到问题,可以尝试创建一个新的项目并手动安装依赖项:
mkdir new-project
cd new-project
npm init -y
npm install msnodesql
npm install iroute
希望这些步骤能帮助你解决问题!如果还有其他问题,请提供更多的详细信息。
有人知道么??
目测你要安装 x86 的node ,而不是x64 的node
是x64的node啊,到底怎么回事,抓狂
你当时如何解决的呢?看到麻烦回复下我