最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

将Reactjs应用程序推送到Heroku,给出了fsevents错误

运维笔记admin11浏览0评论

将Reactjs应用程序推送到Heroku,给出了fsevents错误

将Reactjs应用程序推送到Heroku,给出了fsevents错误

我遵循,并且能够创建项目。但是当我试图推动项目时,它给了我fsevents错误。这是一个全新的项目。

  1. 我在node_modules添加了.gitignore
  2. 我在npm i -f尝试过
  3. 我曾尝试在fsevents中将optionalDependencies添加到

没有这些帮助了我。我得到的错误:

Building dependencies
remote:        Installing node modules (package.json + package-lock)
remote:        npm ERR! code EBADPLATFORM
remote:        npm ERR! notsup Unsupported platform for [email protected]:     wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
remote:        npm ERR! notsup Valid OS:    darwin
remote:        npm ERR! notsup Valid Arch:  any
remote:        npm ERR! notsup Actual OS:   linux
remote:        npm ERR! notsup Actual Arch: x64
remote:        
remote:        npm ERR! A complete log of this run can be found in:
remote:        npm ERR!     /tmp/npmcache.y1nYC/_logs/2018-04-09T15_10_24_227Z-debug.log
remote: 
remote: -----> Build failed

我的package.json如下

{
  "name": "my_site",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "react": "^16.3.1",
    "react-dom": "^16.3.1",
    "react-scripts": "1.1.4"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test --env=jsdom",
    "eject": "react-scripts eject"
  }
}
回答如下:

在package.json文件中添加以下脚本后,我的构建成功。

"scripts": {
    ...
    "heroku-prebuild": "npm i -f",
    "heroku-postbuild": "npm run build"
}
发布评论

评论列表(0)

  1. 暂无评论