NPM&Yarn-React导致的错误?

时间:2018-11-10 02:44:19

标签: node.js windows reactjs npm yarnpkg

我无法运行npm installnpm start。当我尝试npm install时,出现以下错误:

> aristophanes@1.0.0 postinstall C:\Users\Aristophanes
> cd packages/react-error-overlay/ && yarn build:prod

bash: line 0: cd: packages/react-error-overlay/: No such file or directory
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! aristophanes@1.0.0 postinstall: `cd packages/react-error-overlay/ && yarn build:prod`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the aristophanes@1.0.0 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\Aristophanes\AppData\Roaming\npm-cache\_logs\2018-11-09T13_25_48_830Z-debug.log

调试日志:2018-11-09T13_25_48_830Z-debug.log

全局npm package.jsonpackage.json

用户目录npm package.jsonpackage.json

我不确定这是何时以及为什么开始发生的,但是我认为这与反应有关。我看到一个类似的问题,用户说他们使用 Yarn create-react-app/issues#4308解决了这个问题。好吧,我安装了 Yarn ,但是yarn start给了我这个错误:

$ cd packages/react-scripts && node bin/react-scripts.js start
/d: /d: Is a directory
error Command failed with exit code 126.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

我的纱线 package.json

{
  "name": "yarn",
  "installationMethod": "choco",
  "version": "1.12.3",
  "license": "BSD-2-Clause",
  "preferGlobal": true,
  "description": " Fast, reliable, and secure dependency management.",
  "resolutions": {
    "sshpk": "^1.14.2"
  },
  "engines": {
    "node": ">=4.0.0"
  },
  "repository": "yarnpkg/yarn",
  "bin": {
    "yarn": "./bin/yarn.js",
    "yarnpkg": "./bin/yarn.js"
  },
  "config": {
    "commitizen": {
      "path": "./node_modules/cz-conventional-changelog"
    }
  }
}

几天来我一直无法完成任何工作。似乎没人知道解决方案。我什至尝试切换到Ubuntu,但在那里我也遇到类似的错误。

0 个答案:

没有答案