Реагировать не удалось скомпилировать postcss, yamldumper.js - PullRequest
0 голосов
/ 19 ноября 2018

В Windows При попытке скомпилировать свежеприготовленное приложение реагирования из «create-реагировать-приложение» я получаю сообщение об ошибке компиляции.Не уверен, откуда взялся неожиданный токен.Ошибка ссылается на неожиданный токен в index.css, созданный при создании create-реагировать на приложение.

index.css:

body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen",
    "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue",
    sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

code {
  font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New",
    monospace;
}

Вывод из установки и запуска ниже:

D:\Projects\reactsites>cd Test2

D:\Projects\reactsites\Test2>npx create-react-app derpsocial

Creating a new React app in D:\Projects\reactsites\Test2\derpsocial.

Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts...

yarn add v1.9.4
[1/4] Resolving packages...
[2/4] Fetching packages...
[-----------------------------------------------------------------------] 0/1283(
node:3584) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
info fsevents@1.2.4: The platform "win32" is incompatible with this module.
info "fsevents@1.2.4" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
[4/4] Building fresh packages...

success Saved lockfile.
warning Your current version of Yarn is out of date. The latest version is "1.12.
3", while you're on "1.9.4".
info To upgrade, download the latest installer at "https://yarnpkg.com/latest.msi".
success Saved 6 new dependencies.
info Direct dependencies
├─ react-dom@16.6.3
├─ react-scripts@2.1.1
└─ react@16.6.3
info All dependencies
├─ babel-preset-react-app@6.1.0
├─ react-dev-utils@6.1.1
├─ react-dom@16.6.3
├─ react-error-overlay@5.1.0
├─ react-scripts@2.1.1
└─ react@16.6.3
Done in 236.47s.

Initialized a git repository.

Success! Created derpsocial at D:\Projects\reactsites\Test2\derpsocial
Inside that directory, you can run several commands:

  yarn start
    Starts the development server.

  yarn build
    Bundles the app into static files for production.

  yarn test
    Starts the test runner.

  yarn eject
    Removes this tool and copies build dependencies, configuration files
    and scripts into the app directory. If you do this, you can't go back!

We suggest that you begin by typing:

  cd derpsocial
  yarn start

Happy hacking!

D:\Projects\reactsites\Test2>cd derpsocial

D:\Projects\reactsites\Test2\derpsocial>yarn start
yarn run v1.9.4
$ react-scripts start
Failed to compile.

./src/index.css (./node_modules/css-loader??ref--6-oneOf-3-1!./node_modules/postcss-loader/src??postcss!./src/index.css)
D:\Projects\reactsites\Test2\derpsocial\node_modules\js-yaml\lib\js-yaml\dumper.js:275
  return result;
  ^^^^^^

SyntaxError: Unexpected token return

D:\Projects\reactsites\Test2\derpsocial>npm -version
6.4.1

D:\Projects\reactsites\Test2\derpsocial>node -v
v10.13.0

D:\Projects\reactsites\Test2\derpsocial>

Я пытался обновить все пакеты, даже вынул css из index.css с той же самой ошибкой.Переустановил узел и npm.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...