我是nodeJS的新手,所以这可能是一个愚蠢的问题。
我刚刚安装了nodejs,node-gyp,npm,git,Python和MS Visual Studio C ++ Express。
当我执行"npm install"
时,我得到以下输出:
npm WARN package.json strider@1.6.6 No license field.
> contextify@0.1.14 install C:\Users\W7\Documents\GitHub\strider\node_modules\angular\node_modules\jsdom\node_modules\contextify
> node-gyp rebuild
C:\Users\W7\Documents\GitHub\strider\node_modules\angular\node_modules\jsdom\node_modules\contextify>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node rebuild )
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.Cpp.Platform.targets(42,5): error MSB8020: The builds tools for Visual Studio 2010 (Platform Toolset = 'v100') cannot be found. To build using the v100 build tools, either click the Project menu or right-click the solution, and then select "Update VC++ Projects...". Install Visual Studio 2010 to build using the Visual Studio 2010 build tools. [C:\Users\W7\Documents\GitHub\strider\node_modules\angular\node_modules\jsdom\node_modules\contextify\build\contextify.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:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:269:23)
gyp ERR! stack at ChildProcess.emit (events.js:110:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:1074:12)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "node" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\W7\Documents\GitHub\strider\node_modules\angular\node_modules\jsdom\node_modules\contextify
gyp ERR! node -v v0.12.5
gyp ERR! node-gyp -v v2.0.1
gyp ERR! not ok
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! node v0.12.5
npm ERR! npm v2.11.2
npm ERR! code EBADPLATFORM
npm ERR! notsup Unsupported
npm ERR! notsup Not compatible with your operating system or architecture: n@1.3.0
npm ERR! notsup Valid OS: !win32
npm ERR! notsup Valid Arch: any
npm ERR! notsup Actual OS: win32
npm ERR! notsup Actual Arch: x64
npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\W7\Documents\GitHub\strider\npm-debug.log
我可能错过了什么,有人知道如何解决这个问题吗?
我正在使用Windows 7 64。
答案 0 :(得分:0)
更改您的软件包或操作系统,此操作系统不支持此软件包。
答案 1 :(得分:0)
您正在尝试在Windows下安装n
软件包。在他们的github页面(https://github.com/tj/n)上说,它不能在Windows上本地运行
(注意:Windows本身不支持
n
。)
您可以尝试使用nvm-windows
软件包,但我从未使用过。
或者,您可以在计算机上设置Windows Subsystem for Linux。我每天都会使用它,并且可以推荐它。
编辑:我刚刚读到您正在运行Windows 7,而WSL仅在Windows 10上有效。我建议升级。