Wie empfohlen, habe ich "npm install -g angular-cli" ausgeführt, um das CLI-Tool zu installieren.Fehler beim Versuch, das Angular-cli-Tool zu installieren
Ich habe Windows-Tools mit "npm install --global --production windows-build-tools" und auch "npm install -g node-gyp" beide über Powershell als Administrator ausgeführt.
Ich kann immer noch nicht zur Arbeit ... Ich weiß, Python 2.7 ist installiert und gyp wie ich andere Projekte installiert haben, aber dieses schlägt fehl.
Der Fehler ist wie folgt:
PS C:\WINDOWS\system32> npm install -g angular-cli
npm WARN deprecated [email protected]: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update t
o [email protected]^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated [email protected]: This package is discontinued. Use [email protected]^4.0.0.
npm WARN deprecated [email protected]: This package is deprecated. Use Object.assign.
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated [email protected]: ReDoS vulnerability parsing Set-Cookie https://nodesecurity.io/advisories/130
C:\Users\simon\AppData\Roaming\npm\ng -> C:\Users\simon\AppData\Roaming\npm\node_modules\angular-cli\bin\ng
> [email protected] install C:\Users\simon\AppData\Roaming\npm\node_modules\angular-cli\node_modules\node-zopfli
> node-pre-gyp install --fallback-to-build
node-pre-gyp ERR! Tried to download: https://node-zopfli.s3.amazonaws.com/Release/zopfli-v1.4.0-node-v48-win32-x64.tar.g
z
node-pre-gyp ERR! Pre-built binaries not found for [email protected] and [email protected] (node-v48 ABI) (falling back to sour
ce compile with node-gyp)
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 vers
ion in the project property pages or by right-clicking the solution and selecting "Retarget solution". [C:\Users\simon\
AppData\Roaming\npm\node_modules\angular-cli\node_modules\node-zopfli\build\zopfli.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe` failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Users\simon\AppData\Roaming\npm\node_modules\angular-cli\node_modules\node
-gyp\lib\build.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\\simon\\AppData\\Roaming\\npm\\node_modules\\angular-c
li\\node_modules\\node-gyp\\bin\\node-gyp.js" "build" "--fallback-to-build" "--module=C:\\Users\\simon\\AppData\\Roaming
\\npm\\node_modules\\angular-cli\\node_modules\\node-zopfli\\lib\\binding\\node-v48-win32-x64\\zopfli.node" "--module_na
me=zopfli" "--module_path=C:\\Users\\simon\\AppData\\Roaming\\npm\\node_modules\\angular-cli\\node_modules\\node-zopfli\
\lib\\binding\\node-v48-win32-x64"
gyp ERR! cwd C:\Users\simon\AppData\Roaming\npm\node_modules\angular-cli\node_modules\node-zopfli
gyp ERR! node -v v6.6.0
gyp ERR! node-gyp -v v3.4.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\simon\AppData\Roaming\npm\no
de_modules\angular-cli\node_modules\node-gyp\bin\node-gyp.js build --fallback-to-build --module=C:\Users\simon\AppData\R
oaming\npm\node_modules\angular-cli\node_modules\node-zopfli\lib\binding\node-v48-win32-x64\zopfli.node --module_name=zo
pfli --module_path=C:\Users\simon\AppData\Roaming\npm\node_modules\angular-cli\node_modules\node-zopfli\lib\binding\node
-v48-win32-x64' (1)
node-pre-gyp ERR! stack at ChildProcess.<anonymous> (C:\Users\simon\AppData\Roaming\npm\node_modules\angular-cli\nod
e_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:191:7)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:877:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
node-pre-gyp ERR! System Windows_NT 10.0.14393
node-pre-gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\simon\\AppData\\Roaming\\npm\\node_modules\\
angular-cli\\node_modules\\node-pre-gyp\\bin\\node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd C:\Users\simon\AppData\Roaming\npm\node_modules\angular-cli\node_modules\node-zopfli
node-pre-gyp ERR! node -v v6.6.0
node-pre-gyp ERR! node-pre-gyp -v v0.6.30
node-pre-gyp ERR! not ok
Failed to execute 'C:\Program Files\nodejs\node.exe C:\Users\simon\AppData\Roaming\npm\node_modules\angular-cli\node_mod
ules\node-gyp\bin\node-gyp.js build --fallback-to-build --module=C:\Users\simon\AppData\Roaming\npm\node_modules\angular
-cli\node_modules\node-zopfli\lib\binding\node-v48-win32-x64\zopfli.node --module_name=zopfli --module_path=C:\Users\sim
on\AppData\Roaming\npm\node_modules\angular-cli\node_modules\node-zopfli\lib\binding\node-v48-win32-x64' (1)
npm WARN install:[email protected] [email protected] install: `node-pre-gyp install --fallback-to-build`
npm WARN install:[email protected] Exit status 1
C:\Users\simon\AppData\Roaming\npm
`-- [email protected]
npm WARN optional Skipping failed optional dependency /angular-cli/chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: [email protected]
Ich nehme zur Kenntnis, dass FSEvents ausgefallen ist (NPM am Boden WARN) ... aber es ist seine eine optionale Abhängigkeit sagen.
Ich habe andere Fragen besucht, wo ich cli deinstalliert haben/gelöscht den Cache und dann reistalled neuesten ...
Nachdem Sie das getan und dann den PC neu zu starten versuchte ich zuerst --help ng und bekam:
C:\Users\simon\SPA\CLI-MASTER\Test>ng --help
fs.js:640
return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
^
TypeError: path must be a string or Buffer
at TypeError (native)
at Object.fs.openSync (fs.js:640:18)
at Object.fs.readFileSync (fs.js:508:33)
at Function.Version.fromProject (C:\Users\simon\AppData\Roaming\npm\node_modules\angular-cli\upgrade\version.js:87:31)
at Function.Version.isPreWebpack (C:\Users\simon\AppData\Roaming\npm\node_modules\angular-cli\upgrade\version.js:111:31)
at Function.Version.assertPostWebpackVersion (C:\Users\simon\AppData\Roaming\npm\node_modules\angular-cli\upgrade\version.js:97:18)
at C:\Users\simon\AppData\Roaming\npm\node_modules\angular-cli\bin\ng:25:15
at C:\Users\simon\AppData\Roaming\npm\node_modules\angular-cli\node_modules\resolve\lib\async.js:44:21
at ondir (C:\Users\simon\AppData\Roaming\npm\node_modules\angular-cli\node_modules\resolve\lib\async.js:187:31)
at C:\Users\simon\AppData\Roaming\npm\node_modules\angular-cli\node_modules\resolve\lib\async.js:153:39
Nicht das, was ich hatte gehofft, für ...
Wie kann ich dieses Problem zu beheben und die CLI-Tool zur Arbeit?
haben Sie Ihren Knoten aktualisieren + Installation npm? oder vielleicht der aktuelle Knoten-gyp in Ihrem Rechner nicht kompatibel zu Ihrer aktuellen Knoten Installation –
Running Node 6.6.0 und npm 3.10.3 .. Ich bin mir nicht sicher, ob Kompatibilität mit Knoten 6.6.0 usw. ist. Ich weiß es einfach nicht ... aber ich hätte gedacht, dass die Leute das CLI-Tool entwickeln würden, würde das Neueste beinhalten, da sie noch zu finalisieren sind und die neuen Tools usw. verwenden würden. – si2030
Ich hatte die gleichen Probleme, musste aber node-gyp auf Version zurücksetzen 2.7 weil^3 nicht unterstützt wurde. Überprüfen Sie, welche Version Sie installiert haben. –