如何解决与包 node-gyp 相关的节点包管理器错误?

How to solve node package manager errors with related to package node-gyp?

我知道这个问题已经得到回答 。 但是我无法使用 provided.After npm install 方法解决这种情况,我得到了这些错误,试图重建 node-gyp 没有收获。 节点=v7.2.0 Npm = 3.10.9

C:\Users\Pirate\Desktop\Nem\nem_find\node_modules\buffertools>if not defined npm_config_node_gyp (node "C:\Users\Pira
te\AppData\Roaming\nvm\v7.2.0\node_modules\npm\bin\node-gyp-bin\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (nod
e "" 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\V140\Platforms\x64\PlatformToolsets\v140\Toolset.targets(36,5): error MSB8036:
The Windows SDK version 8.1 was not found. Install the required version of Windows SDK or change the SDK version in the project p
roperty pages or by right-clicking the solution and selecting "Retarget solution". [C:\Users\Pirate\Desktop\Nem\nem_find\node_modules\buffertools\build\buffertools.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild.0\bin\msbuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Users\Pirate\AppData\Roaming\nvm\v7.2.0\node_modules\npm\node_modules\node-gyp\lib\b
uild.js:276:23)
gyp ERR! stack     at emitTwo (events.js:106:13)
gyp ERR! stack     at ChildProcess.emit (events.js:191: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 "C:\Program Files\nodejs\node.exe" "C:\Users\Pirate\AppData\Roaming\nvm\v7.2.0\node_modules\npm\node_
modules\node-gyp\bin\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\Pirate\Desktop\Nem\nem_find\node_modules\buffertools
gyp ERR! node -v v7.2.0
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok

> node-expat@2.3.15 install C:\Users\Pirate\Desktop\Nem\nem_find\node_modules\node-expat
> node-gyp rebuild
e\AppData\Roaming\nvm\v7.2.0\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\V140\Platforms\x64\PlatformToolsets\v140\Toolset.targets(36,5): error MSB8036:
The Windows SDK version 8.1 was not found. Install the required version of Windows SDK or change the SDK version in the project p
roperty pages or by right-clicking the solution and selecting "Retarget solution". [C:\Users\Pirate\Desktop\Nem\nem_find\node_modules\node-expat\build\deps\libexpat\expat.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild.0\bin\msbuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Users\Pirate\AppData\Roaming\nvm\v7.2.0\node_modules\npm\node_modules\node-gyp\lib\b
uild.js:276:23)
gyp ERR! stack     at emitTwo (events.js:106:13)
gyp ERR! stack     at ChildProcess.emit (events.js:191: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 "C:\Program Files\nodejs\node.exe" "C:\Users\Pirate\AppData\Roaming\nvm\v7.2.0\node_modules\npm\node_
modules\node-gyp\bin\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\Pirate\Desktop\Nem\nem_find\node_modules\node-expat
gyp ERR! node -v v7.2.0
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok
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.0.15: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN kue-scheduler@0.1.1 requires a peer of async@^0.9.0 but none was installed.
npm WARN kue-scheduler@0.1.1 requires a peer of lodash@^3.6.0 but none was installed.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: buffertools@2.1.4 (node_modules\buffertools):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: buffertools@2.1.4 install: `node-gyp rebuild`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "install"
npm ERR! node v7.2.0
npm ERR! npm  v3.10.9
npm ERR! code ELIFECYCLE  


npm ERR! node v7.2.0
npm ERR! npm  v3.10.9
npm ERR! code ELIFECYCLE

npm ERR! node-expat@2.3.15 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-expat@2.3.15 install script 'node-gyp rebuild'.
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-expat package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs node-expat
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls node-expat
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Users\Pirate\Desktop\Nem\nem_find\npm-debug.log

**/ npm 安装后的新响应..

npm ERR! node-expat@2.3.15 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-expat@2.3.15 install script 'node-gyp rebuild'.
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-expat package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs node-expat
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls node-expat
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\users\pirate\desktop\nem\backup\nem_find\npm-debug.log

看起来问题与此有关:

The Windows SDK version 8.1 was not found. Install the required version of Windows SDK or change the SDK version in the project p roperty pages or by right-clicking the solution and selecting "Retarget solution". [C:\Users\Pirate\Desktop\Nem\nem_find\node_modules\node-expat\build\deps\libexpat\expat.vcxproj]

您需要 install Windows SDK 才能使用 node-gyp 重新编译。

再次检查您的 package.json 文件,它们是否可用 node-gyp 模块,如果没有可用的版本 ID,则添加并再次从 npm 安装。

您是否尝试过将 npm 升级到 v4.x? npm 安装 npm@latest -g

我在 3.10.6 的 shrinkwrap 和 fsevents 包中遇到了问题,它是 Mac Os 特定的。如果我删除 npmshrinkwrap.json 文件,我可以 运行 npm i 并且 运行 没问题。一旦我升级到 npm 的 v4.0.3,它就可以使用 shrinkwrap。当然,这一切都假设您使用 shrinkwrap。

我在上面发表了评论,但有必要让大家 know.It 我只花了 15 分钟就在 Debian 上设置了所有内容。 我的建议是转移到 mac 或 Linux,我尊重@Microsoft 在云方面所做的一切,但在 windows 上他们还没有,这将需要他们另一个10年解决社区发展问题。你问任何我的意思是任何使用 MEAN Django 或 ROR 的开发人员他们不会推荐 windows 只是因为它不可靠你不能信任 windows.....sad:(