本文介绍了在核心失败-js安装后脚本错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试在现有的Angular project中安装节点模块时,我遇到以下错误。我正在尝试在Windows计算机(Win32 X64)中安装节点模块。

       > [email protected] postinstall node_modulesabel-runtime
ode_modulescore-js 
       > node -e "try{require('-/postinstall')}catch(e){}"

      npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules
g-cli-pug-loader
ode_modulesfsevents):
      npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted ("os":"darwin","arch":"any") (current: {"as":"vin3 
      npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules@angularcompiler-cli
ode_modulesfsevents): arch":"x64"})

      npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted ("os": "darwin","arch":"any") (current: {"as":"u ","arch":"x64"}) 
      npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modulesfsevents): 
      npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted ("os": "darwin","arch":"any") (current: {"as":"win32","arch":"x64"})

      npm ERR! code ELIFECYCLE

      npm ERR! syscall spawn bash

      npm ERR! file bash

      npm ERR! path bash

      npm ERR! errno -4058

      npm ERR! [email protected] postinstall: "node -e "try(require('./postinstall')}catch(e){}"

      npm ERR! spawn bash ENOENT

      npm ERR!

      npm ERR! Failed at the [email protected] 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:Users	estAppDataRoaming
pm-cache\_logs2021-06-23T16_43_06_961Z-debug.log
       

以下是安装在我的系统中的版本

  AngularCli : 8.3.29
  Node : 14.17.1
  NPM: 8.2.12

我已尝试删除节点模块文件夹并运行npm cache clean --force并重新安装节点模块,还尝试卸载NodeJS并删除npm-cache文件夹并重新安装。

我仍然面临着同样的问题。如有任何帮助,我们将不胜感激。

推荐答案

此错误意味着安装后脚本是forkexecingbash,这在Windows上不存在。您需要从像MINGW64(Git Bash)这样的Bash模拟器运行此脚本。

这篇关于在核心失败-js安装后脚本错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-28 03:15