无法使用 npm 安装 StrongLoop

Cannot install StrongLoop with npm

在尝试使用 npm 安装 StrongLoop 时出现此错误:

$ npm install -g strongloop
npm WARN deprecated minimatch@0.3.0: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated node-uuid@1.4.7: use uuid module instead
npm WARN deprecated minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
C:\Users\abdessamad\.npm-global\lb-ng -> C:\Users\abdessamad\.npm-global\node_modules\strongloop\node_modules\loopback-sdk-angular-cli\bin\lb-ng.js
C:\Users\abdessamad\.npm-global\slc -> C:\Users\abdessamad\.npm-global\node_modules\strongloop\bin\slc.js

> heapdump@0.3.7 install C:\Users\abdessamad\.npm-global\node_modules\strongloop\node_modules\heapdump
> node-gyp rebuild


C:\Users\abdessamad\.npm-global\node_modules\strongloop\node_modules\heapdump>if not defined npm_config_node_gyp (node "C:\Users\abdessamad\.npm-global\node_modules\npm\bin\node-gyp-bin\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "" rebuild )
gyp ERR! build error
gyp ERR! stack Error: Command failed: reg query "HKLM\Software\Microsoft\MSBuild\ToolsVersions" /s /reg:32
gyp ERR! stack 'reg' n'est pas reconnu en tant que commande interne
gyp ERR! stack ou externe, un programme ex�cutable ou un fichier de commandes.
gyp ERR! stack
gyp ERR! stack Can't find "msbuild.exe". Do you have Microsoft Visual Studio C++ 2008+ installed?
gyp ERR! stack     at C:\Users\abdessamad\.npm-global\node_modules\npm\node_modules\node-gyp\lib\build.js:134:25
gyp ERR! stack     at ChildProcess.exithandler (child_process.js:218:5)
gyp ERR! stack     at emitTwo (events.js:106:13)
gyp ERR! stack     at ChildProcess.emit (events.js:192:7)
gyp ERR! stack     at maybeClose (internal/child_process.js:890:16)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Users\abdessamad\.npm-global\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\abdessamad\.npm-global\node_modules\strongloop\node_modules\heapdump
gyp ERR! node -v v7.5.0
gyp ERR! node-gyp -v v3.5.0
gyp ERR! not ok

> sqlite3@3.1.4 install C:\Users\abdessamad\.npm-global\node_modules\strongloop\node_modules\sqlite3
> node-pre-gyp install --fallback-to-build

node-pre-gyp ERR! Tried to download: https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v3.1.4/node-v51-win32-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for sqlite3@3.1.4 and node@7.5.0 (node-v51 ABI) (falling back to source compile with node-gyp)
gyp ERR! build error
gyp ERR! stack Error: Command failed: reg query "HKLM\Software\Microsoft\MSBuild\ToolsVersions" /s /reg:32
gyp ERR! stack 'reg' n'est pas reconnu en tant que commande interne
gyp ERR! stack ou externe, un programme ex�cutable ou un fichier de commandes.
gyp ERR! stack
gyp ERR! stack Can't find "msbuild.exe". Do you have Microsoft Visual Studio C++ 2008+ installed?
gyp ERR! stack     at C:\Users\abdessamad\.npm-global\node_modules\node-gyp\lib\build.js:134:25
gyp ERR! stack     at ChildProcess.exithandler (child_process.js:218:5)
gyp ERR! stack     at emitTwo (events.js:106:13)
gyp ERR! stack     at ChildProcess.emit (events.js:192:7)
gyp ERR! stack     at maybeClose (internal/child_process.js:890:16)
gyp ERR! stack     at Socket.<anonymous> (internal/child_process.js:334:11)
gyp ERR! stack     at emitOne (events.js:96:13)
gyp ERR! stack     at Socket.emit (events.js:189:7)
gyp ERR! stack     at Pipe._handle.close [as _onclose] (net.js:501:12)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Users\abdessamad\.npm-global\node_modules\node-gyp\bin\node-gyp.js" "build" "--fallback-to-build" "--module=C:\Users\abdessamad\.npm-global\node_modules\strongloop\node_modules\sqlite3\lib\binding\node-v51-win32-x64\node_sqlite3.node" "--module_name=node_sqlite3" "--module_path=C:\Users\abdessamad\.npm-global\node_modules\strongloop\node_modules\sqlite3\lib\binding\node-v51-win32-x64"
gyp ERR! cwd C:\Users\abdessamad\.npm-global\node_modules\strongloop\node_modules\sqlite3
gyp ERR! node -v v7.5.0
gyp ERR! node-gyp -v v3.5.0
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute 'C:\Program Files\nodejs\node.exe C:\Users\abdessamad\.npm-global\node_modules\node-gyp\bin\node-gyp.js build --fallback-to-build --module=C:\Users\abdessamad\.npm-global\node_modules\strongloop\node_modules\sqlite3\lib\binding\node-v51-win32-x64\node_sqlite3.node --module_name=node_sqlite3 --module_path=C:\Users\abdessamad\.npm-global\node_modules\strongloop\node_modules\sqlite3\lib\binding\node-v51-win32-x64' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (C:\Users\abdessamad\.npm-global\node_modules\strongloop\node_modules\sqlite3\node_modules\node-pre-gyp\lib\util\compile.js:83:29)
node-pre-gyp ERR! stack     at emitTwo (events.js:106:13)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:192:7)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:890:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
node-pre-gyp ERR! System Windows_NT 6.1.7601
node-pre-gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Users\abdessamad\.npm-global\node_modules\strongloop\node_modules\sqlite3\node_modules\node-pre-gyp\bin\node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd C:\Users\abdessamad\.npm-global\node_modules\strongloop\node_modules\sqlite3
node-pre-gyp ERR! node -v v7.5.0
node-pre-gyp ERR! node-pre-gyp -v v0.6.28
node-pre-gyp ERR! not ok
Failed to execute 'C:\Program Files\nodejs\node.exe C:\Users\abdessamad\.npm-global\node_modules\node-gyp\bin\node-gyp.js build --fallback-to-build --module=C:\Users\abdessamad\.npm-global\node_modules\strongloop\node_modules\sqlite3\lib\binding\node-v51-win32-x64\node_sqlite3.node --module_name=node_sqlite3 --module_path=C:\Users\abdessamad\.npm-global\node_modules\strongloop\node_modules\sqlite3\lib\binding\node-v51-win32-x64' (1)

> strong-agent@2.1.2 install C:\Users\abdessamad\.npm-global\node_modules\strongloop\node_modules\strong-agent
> node-gyp rebuild || exit 0


C:\Users\abdessamad\.npm-global\node_modules\strongloop\node_modules\strong-agent>if not defined npm_config_node_gyp (node "C:\Users\abdessamad\.npm-global\node_modules\npm\bin\node-gyp-bin\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "" rebuild )
Warning: Missing input files:
C:\Users\abdessamad\.npm-global\node_modules\strongloop\node_modules\strong-agent\build\..\src\features.h
gyp ERR! build error
gyp ERR! stack Error: Command failed: reg query "HKLM\Software\Microsoft\MSBuild\ToolsVersions" /s /reg:32
gyp ERR! stack 'reg' n'est pas reconnu en tant que commande interne
gyp ERR! stack ou externe, un programme ex�cutable ou un fichier de commandes.
gyp ERR! stack
gyp ERR! stack Can't find "msbuild.exe". Do you have Microsoft Visual Studio C++ 2008+ installed?
gyp ERR! stack     at C:\Users\abdessamad\.npm-global\node_modules\npm\node_modules\node-gyp\lib\build.js:134:25
gyp ERR! stack     at ChildProcess.exithandler (child_process.js:218:5)
gyp ERR! stack     at emitTwo (events.js:106:13)
gyp ERR! stack     at ChildProcess.emit (events.js:192:7)
gyp ERR! stack     at maybeClose (internal/child_process.js:890:16)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Users\abdessamad\.npm-global\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\abdessamad\.npm-global\node_modules\strongloop\node_modules\strong-agent
gyp ERR! node -v v7.5.0
gyp ERR! node-gyp -v v3.5.0
gyp ERR! not ok

> ws@0.4.32 install C:\Users\abdessamad\.npm-global\node_modules\strongloop\node_modules\node-inspector\node_modules\ws
> (node-gyp rebuild 2> builderror.log) || (exit 0)


C:\Users\abdessamad\.npm-global\node_modules\strongloop\node_modules\node-inspector\node_modules\ws>if not defined npm_config_node_gyp (node "C:\Users\abdessamad\.npm-global\node_modules\npm\bin\node-gyp-bin\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "" rebuild )

> utf-8-validate@1.2.2 install C:\Users\abdessamad\.npm-global\node_modules\strongloop\node_modules\utf-8-validate
> node-gyp rebuild


C:\Users\abdessamad\.npm-global\node_modules\strongloop\node_modules\utf-8-validate>if not defined npm_config_node_gyp (node "C:\Users\abdessamad\.npm-global\node_modules\npm\bin\node-gyp-bin\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "" rebuild )
gyp ERR! build error
gyp ERR! stack Error: Command failed: reg query "HKLM\Software\Microsoft\MSBuild\ToolsVersions" /s /reg:32
gyp ERR! stack 'reg' n'est pas reconnu en tant que commande interne
gyp ERR! stack ou externe, un programme ex�cutable ou un fichier de commandes.
gyp ERR! stack
gyp ERR! stack Can't find "msbuild.exe". Do you have Microsoft Visual Studio C++ 2008+ installed?
gyp ERR! stack     at C:\Users\abdessamad\.npm-global\node_modules\npm\node_modules\node-gyp\lib\build.js:134:25
gyp ERR! stack     at ChildProcess.exithandler (child_process.js:218:5)
gyp ERR! stack     at emitTwo (events.js:106:13)
gyp ERR! stack     at ChildProcess.emit (events.js:192:7)
gyp ERR! stack     at maybeClose (internal/child_process.js:890:16)
gyp ERR! stack     at Socket.<anonymous> (internal/child_process.js:334:11)
gyp ERR! stack     at emitOne (events.js:96:13)
gyp ERR! stack     at Socket.emit (events.js:189:7)
gyp ERR! stack     at Pipe._handle.close [as _onclose] (net.js:501:12)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Users\abdessamad\.npm-global\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\abdessamad\.npm-global\node_modules\strongloop\node_modules\utf-8-validate
gyp ERR! node -v v7.5.0
gyp ERR! node-gyp -v v3.5.0
gyp ERR! not ok

> bufferutil@1.2.1 install C:\Users\abdessamad\.npm-global\node_modules\strongloop\node_modules\ws\node_modules\bufferutil
> node-gyp rebuild


C:\Users\abdessamad\.npm-global\node_modules\strongloop\node_modules\ws\node_modules\bufferutil>if not defined npm_config_node_gyp (node "C:\Users\abdessamad\.npm-global\node_modules\npm\bin\node-gyp-bin\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "" rebuild )
gyp ERR! build error
gyp ERR! stack Error: Command failed: reg query "HKLM\Software\Microsoft\MSBuild\ToolsVersions" /s /reg:32
gyp ERR! stack 'reg' n'est pas reconnu en tant que commande interne
gyp ERR! stack ou externe, un programme ex�cutable ou un fichier de commandes.
gyp ERR! stack
gyp ERR! stack Can't find "msbuild.exe". Do you have Microsoft Visual Studio C++ 2008+ installed?
gyp ERR! stack     at C:\Users\abdessamad\.npm-global\node_modules\npm\node_modules\node-gyp\lib\build.js:134:25
gyp ERR! stack     at ChildProcess.exithandler (child_process.js:218:5)
gyp ERR! stack     at emitTwo (events.js:106:13)
gyp ERR! stack     at ChildProcess.emit (events.js:192:7)
gyp ERR! stack     at maybeClose (internal/child_process.js:890:16)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Users\abdessamad\.npm-global\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\abdessamad\.npm-global\node_modules\strongloop\node_modules\ws\node_modules\bufferutil
gyp ERR! node -v v7.5.0
gyp ERR! node-gyp -v v3.5.0
gyp ERR! not ok

> strong-mesh-client@1.6.3 install C:\Users\abdessamad\.npm-global\node_modules\strongloop\node_modules\strong-mesh-client
> node proxy/build-client.js

(node:6832) DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead.
browser bundle successfully generated

> bufferutil@1.3.0 install C:\Users\abdessamad\.npm-global\node_modules\strongloop\node_modules\bufferutil
> node-gyp rebuild


C:\Users\abdessamad\.npm-global\node_modules\strongloop\node_modules\bufferutil>if not defined npm_config_node_gyp (node "C:\Users\abdessamad\.npm-global\node_modules\npm\bin\node-gyp-bin\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "" rebuild )
gyp ERR! build error
gyp ERR! stack Error: Command failed: reg query "HKLM\Software\Microsoft\MSBuild\ToolsVersions" /s /reg:32
gyp ERR! stack 'reg' n'est pas reconnu en tant que commande interne
gyp ERR! stack ou externe, un programme ex�cutable ou un fichier de commandes.
gyp ERR! stack
gyp ERR! stack Can't find "msbuild.exe". Do you have Microsoft Visual Studio C++ 2008+ installed?
gyp ERR! stack     at C:\Users\abdessamad\.npm-global\node_modules\npm\node_modules\node-gyp\lib\build.js:134:25
gyp ERR! stack     at ChildProcess.exithandler (child_process.js:218:5)
gyp ERR! stack     at emitTwo (events.js:106:13)
gyp ERR! stack     at ChildProcess.emit (events.js:192:7)
gyp ERR! stack     at maybeClose (internal/child_process.js:890:16)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Users\abdessamad\.npm-global\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\abdessamad\.npm-global\node_modules\strongloop\node_modules\bufferutil
gyp ERR! node -v v7.5.0
gyp ERR! node-gyp -v v3.5.0
gyp ERR! not ok

> strong-debugger@1.0.0 install C:\Users\abdessamad\.npm-global\node_modules\strongloop\node_modules\strong-debugger
> node-gyp rebuild


C:\Users\abdessamad\.npm-global\node_modules\strongloop\node_modules\strong-debugger>if not defined npm_config_node_gyp (node "C:\Users\abdessamad\.npm-global\node_modules\npm\bin\node-gyp-bin\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "" rebuild )
gyp ERR! build error
gyp ERR! stack Error: Command failed: reg query "HKLM\Software\Microsoft\MSBuild\ToolsVersions" /s /reg:32
gyp ERR! stack 'reg' n'est pas reconnu en tant que commande interne
gyp ERR! stack ou externe, un programme ex�cutable ou un fichier de commandes.
gyp ERR! stack
gyp ERR! stack Can't find "msbuild.exe". Do you have Microsoft Visual Studio C++ 2008+ installed?
gyp ERR! stack     at C:\Users\abdessamad\.npm-global\node_modules\npm\node_modules\node-gyp\lib\build.js:134:25
gyp ERR! stack     at ChildProcess.exithandler (child_process.js:218:5)
gyp ERR! stack     at emitTwo (events.js:106:13)
gyp ERR! stack     at ChildProcess.emit (events.js:192:7)
gyp ERR! stack     at maybeClose (internal/child_process.js:890:16)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Users\abdessamad\.npm-global\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\abdessamad\.npm-global\node_modules\strongloop\node_modules\strong-debugger
gyp ERR! node -v v7.5.0
gyp ERR! node-gyp -v v3.5.0
gyp ERR! not ok

> spawn-sync@1.0.15 postinstall C:\Users\abdessamad\.npm-global\node_modules\strongloop\node_modules\spawn-sync
> node postinstall

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: modern-syslog@^1.1.2 (node_modules\strongloop\node_modules\modern-syslog):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for modern-syslog@1.1.4: wanted {"os":"!win32","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: modern-syslog@^1.x (node_modules\strongloop\node_modules\strong-supervisor\node_modules\modern-syslog):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for modern-syslog@1.1.4: wanted {"os":"!win32","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: heapdump@0.3.7 (node_modules\strongloop\node_modules\heapdump):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: heapdump@0.3.7 install: `node-gyp rebuild`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: sqlite3@3.1.4 (node_modules\strongloop\node_modules\sqlite3):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: sqlite3@3.1.4 install: `node-pre-gyp install --fallback-to-build`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: utf-8-validate@1.2.2 (node_modules\strongloop\node_modules\utf-8-validate):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: utf-8-validate@1.2.2 install: `node-gyp rebuild`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: bufferutil@1.2.1 (node_modules\strongloop\node_modules\ws\node_modules\bufferutil):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: bufferutil@1.2.1 install: `node-gyp rebuild`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: bufferutil@1.3.0 (node_modules\strongloop\node_modules\bufferutil):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: bufferutil@1.3.0 install: `node-gyp rebuild`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: strong-debugger@1.0.0 (node_modules\strongloop\node_modules\strong-debugger):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: strong-debugger@1.0.0 install: `node-gyp rebuild`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Users\abdessamad\.npm-global\node_modules\npm\bin\npm-cli.js" "install" "-g" "strongloop"
npm ERR! node v7.5.0
npm ERR! npm  v4.2.0
npm ERR! path C:\Users\abdessamad\.npm-global\node_modules\strongloop\node_modules\sqlite3\node_modules\bl\node_modules
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall scandir

npm ERR! Error: EPERM: operation not permitted, scandir 'C:\Users\abdessamad\.npm-global\node_modules\strongloop\node_modules\sqlite3\node_modules\bl\node_modules'
npm ERR!  { Error: EPERM: operation not permitted, scandir 'C:\Users\abdessamad\.npm-global\node_modules\strongloop\node_modules\sqlite3\node_modules\bl\node_modules'
npm ERR!   errno: -4048,
npm ERR!   code: 'EPERM',
npm ERR!   syscall: 'scandir',
npm ERR!   path: 'C:\Users\abdessamad\.npm-global\node_modules\strongloop\node_modules\sqlite3\node_modules\bl\node_modules' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Users\abdessamad\AppData\Roaming\npm-cache\_logs17-02-12T03_18_31_114Z-debug.log

根据您的错误日志,您不是 运行 管理员。执行 npm cache clean

尝试 运行 作为管理员。

对于 Windows:Win + X → 命令提示符为管理员

对于Linux:sudo su

然后重新安装。