Npm 不能安装锋利的工具

Npm 不能安装锋利的工具,npm,sharp,Npm,Sharp,sharp@0.18.4安装C:\Users\hp\AppData\Roaming\npm\node\u modules\sharp 节点gyp重建 C:\Users\hp\AppData\Roaming\npm\node_modules\sharp>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\n

sharp@0.18.4安装C:\Users\hp\AppData\Roaming\npm\node\u modules\sharp

节点gyp重建

C:\Users\hp\AppData\Roaming\npm\node_modules\sharp>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.
MSBUILD : error MSB4132: The tools version "2.0" is unrecognized. Available tools versions are "4.0".
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:258:23)
gyp ERR! stack     at emitTwo (events.js:126:13)
gyp ERR! stack     at ChildProcess.emit (events.js:214:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Windows_NT 10.0.10240
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\hp\AppData\Roaming\npm\node_modules\sharp
gyp ERR! node -v v8.9.3
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
npm WARN Error: EPERM: operation not permitted, rmdir 'C:\Users\hp\AppData\Roaming\npm\node_modules'
npm WARN  { Error: EPERM: operation not permitted, rmdir 'C:\Users\hp\AppData\Roaming\npm\node_modules'
npm WARN   stack: 'Error: EPERM: operation not permitted, rmdir \'C:\\Users\\hp\\AppData\\Roaming\\npm\\node_modules\'',
npm WARN   errno: -4048,
npm WARN   code: 'EPERM',
npm WARN   syscall: 'rmdir',
npm WARN   path: 'C:\\Users\\hp\\AppData\\Roaming\\npm\\node_modules' }
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! sharp@0.18.4 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the sharp@0.18.4 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\hp\AppData\Roaming\npm-cache\_logs\2017-12-27T19_25_54_261Z-debug.log

在windows操作系统上安装sharp最简单的方法是使用以下npm软件包 这就是所谓的

这是npm说的下载

安装Visual C++构建工具,由微软免费提供。编译流行的本机模块需要这些工具。它还将安装Python2.7,适当地配置您的机器和npm

在此之后
npm安装sharp

在windows操作系统上安装sharp最简单的方法是使用以下npm软件包 这就是所谓的

这是npm说的下载

安装Visual C++构建工具,由微软免费提供。编译流行的本机模块需要这些工具。它还将安装Python2.7,适当地配置您的机器和npm

在此之后
npm安装sharp

npm install --global --production windows-build-tools