Npm Install在我的另一个项目上不起作用



Npm安装在我的其他项目上不起作用

Windows 10,NPM-6.14.4,节点gyp-v7.1.0,Angular CLI:9.1.7,节点:12.17.0,操作系统:win32 x64

我正在尝试在我的窗口中运行npm安装。

这是下面的错误

C:UsersSSDDesktopPATH_TO_MY_PROJECT>npm i core-js@3.4.2
'CALL "C:Program Filesnodejs\node.exe" "C:Program Filesnodejs\node_modulesnpmbinnpm-cli.js" prefix -g' is not recognized as an internal or external command,
operable program or batch file.
> core-js@3.6.4 postinstall C:UsersSSDDesktopPATH_TO_MY_PROJECTnode_modules@angular-devkitbuild-angularnode_modulescore-js
> node -e "try{require('./postinstall')}catch(e){}"
npm WARN @ng-bootstrap/ng-bootstrap@7.0.0 requires a peer of @angular/common@^10.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN @ng-bootstrap/ng-bootstrap@7.0.0 requires a peer of @angular/core@^10.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN @ng-bootstrap/ng-bootstrap@7.0.0 requires a peer of @angular/forms@^10.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN @ng-bootstrap/ng-bootstrap@7.0.0 requires a peer of @angular/localize@^10.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN @ngtools/webpack@10.0.7 requires a peer of @angular/compiler-cli@>=10.0.0-next.0 < 11 but none is installed. You must install peer dependencies yourself.
npm WARN @ngtools/webpack@10.0.7 requires a peer of typescript@>=3.9 < 3.10 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_moduleswatchpack-chokidar2node_modulesfsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.1.3 (node_modulesfsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_moduleswebpack-dev-servernode_modulesfsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn C:Windowssystem32cmd.exe;C:Program FilesGitcmd;C:UsersSSDAppDataRoamingPythonPython38Scripts;
npm ERR! file C:Windowssystem32cmd.exe;C:Program FilesGitcmd;C:UsersSSDAppDataRoamingPythonPython38Scripts;
npm ERR! path C:Windowssystem32cmd.exe;C:Program FilesGitcmd;C:UsersSSDAppDataRoamingPythonPython38Scripts;
npm ERR! errno ENOENT
npm ERR! core-js@3.6.4 postinstall: `node -e "try{require('./postinstall')}catch(e){}"`
npm ERR! spawn C:Windowssystem32cmd.exe;C:Program FilesGitcmd;C:UsersSSDAppDataRoamingPythonPython38Scripts; ENOENT
npm ERR!
npm ERR! Failed at the core-js@3.6.4 postinstall 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:UsersSSDAppDataRoamingnpm-cache_logs2020-09-08T08_16_18_627Z-debug.log

这里还有我的错误日志文件:

2167 warn notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
2168 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Valid OS:    darwin
2168 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Valid Arch:  any
2168 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Actual OS:   win32
2168 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Actual Arch: x64
2169 verbose stack Error: core-js@3.6.4 postinstall: `node -e "try{require('./postinstall')}catch(e){}"`
2169 verbose stack spawn C:Windowssystem32cmd.exe;C:Program FilesGitcmd;C:UsersSSDAppDataRoamingPythonPython38Scripts; ENOENT
2169 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:267:19)
2169 verbose stack     at onErrorNT (internal/child_process.js:469:16)
2169 verbose stack     at processTicksAndRejections (internal/process/task_queues.js:84:21)
2170 verbose pkgid core-js@3.6.4
2171 verbose cwd C:UsersSSDDesktopPATH_TO_MY_PROJECT
2172 verbose Windows_NT 10.0.18362
2173 verbose argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "install" "--scripts-prepend-node-path=auto"
2174 verbose node v12.17.0
2175 verbose npm  v6.14.4
2176 error code ELIFECYCLE
2177 error syscall spawn C:Windowssystem32cmd.exe;C:Program FilesGitcmd;C:UsersSSDAppDataRoamingPythonPython38Scripts;
2178 error file C:Windowssystem32cmd.exe;C:Program FilesGitcmd;C:UsersSSDAppDataRoamingPythonPython38Scripts;
2179 error path C:Windowssystem32cmd.exe;C:Program FilesGitcmd;C:UsersSSDAppDataRoamingPythonPython38Scripts;
2180 error errno ENOENT
2181 error core-js@3.6.4 postinstall: `node -e "try{require('./postinstall')}catch(e){}"`
2181 error spawn C:Windowssystem32cmd.exe;C:Program FilesGitcmd;C:UsersSSDAppDataRoamingPythonPython38Scripts; ENOENT
2182 error Failed at the core-js@3.6.4 postinstall script.
2182 error This is probably not a problem with npm. There is likely additional logging output above.
2183 verbose exit [ 1, true ]

任何人都请帮忙。

嗯,你能先尝试npm安装angular,然后再试一次吗?

尝试清除npm&还要确保你有良好的互联网连接
npm cache clean --force

最新更新