Open2

gatsby developを実行するとエラー

Matsukura YukiMatsukura Yuki
  • Macbook Pro M1 Pro上
    • nodebrew上のv18系最新、v20系最新でもエラー
    • Dockerを使ってもエラー。

以下のエラー内容はDocker上の。

root@065991c1b5a6:/app# npm run develop --verbose
npm verb cli /usr/local/bin/node /usr/local/bin/npm
npm info using npm@10.1.0
npm info using node@v20.6.1
npm verb title npm run develop
npm verb argv "run" "develop" "--loglevel" "verbose"
npm verb logfile logs-max:10 dir:/root/.npm/_logs/2023-09-19T02_53_15_317Z-
npm verb logfile /root/.npm/_logs/2023-09-19T02_53_15_317Z-debug-0.log

> matsubo.github.io@1.0.0 develop
> gatsby develop


 ERROR #11903  API.TYPESCRIPT.COMPILATION

There was an unhandled error during compilation for /app. Please run the
command with the --verbose flag again.
std::bad_alloc



  Error: std::bad_alloc

not finished compile gatsby files - 0.179s

npm verb exit 1
npm verb code 1

package.json

root@065991c1b5a6:/app# cat package.json
{
  "name": "matsubo.github.io",
  "version": "1.0.0",
  "private": true,
  "description": "matsubo.github.io",
  "author": "Yuki Matsukura",
  "keywords": [
    "gatsby"
  ],
  "scripts": {
    "develop": "gatsby develop",
    "start": "gatsby develop",
    "build": "gatsby build",
    "serve": "gatsby serve",
    "deploy": "gatsby build  && gh-pages -d public -b main",
    "clean": "gatsby clean"
  },
  "dependencies": {
    "@popperjs/core": "^2.11.8",
    "bootstrap": "^5.3.2",
    "bootswatch": "^5.3.1",
    "gatsby": "^5.12.4",
    "gatsby-plugin-gatsby-cloud": "^5.12.0",
    "gatsby-plugin-image": "^3.12.0",
    "gatsby-plugin-manifest": "^5.12.0",
    "gatsby-plugin-offline": "^6.12.0",
    "gatsby-plugin-robots-txt": "^1.8.0",
    "gatsby-plugin-sass": "^6.12.0",
    "gatsby-plugin-sharp": "^5.12.0",
    "gatsby-plugin-sitemap": "^6.12.0",
    "gatsby-source-filesystem": "^5.12.0",
    "gatsby-transformer-sharp": "^5.12.0",
    "prop-types": "^15.8.1",
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "sass": "^1.67.0"
  },
  "devDependencies": {
    "gh-pages": "^6.0.0"
  }
}
Matsukura YukiMatsukura Yuki

x86のLinux上では動いたから、M1 macでは動かないのかな。。。

> npx gatsby develop
success compile gatsby files - 3.289s
success load gatsby config - 0.097s
success load plugins - 1.310s
success onPreInit - 0.007s
info One or more of your plugins have changed since the last time you ran Gatsby. As
a precaution, we're deleting your site's cache to ensure there's no stale data.
success initialize cache - 0.113s
success copy gatsby files - 0.366s
success Compiling Gatsby Functions - 0.527s
success onPreBootstrap - 0.566s
success createSchemaCustomization - 0.010s
success Clean up stale nodes - 0.016s - 0/0 0.00/s
success Checking for changed pages - 0.002s
success source and transform nodes - 0.240s
success building schema - 0.445s
success createPages - 0.005s
success createPagesStatefully - 0.210s
info Total nodes: 98, SitePage nodes: 17 (use --verbose for breakdown)
success Checking for changed pages - 0.001s
success write out redirect data - 0.002s
success Build manifest and related icons - 0.196s
success onPostBootstrap - 0.203s
info bootstrap finished - 11.515s
success onPreExtractQueries - 0.004s
success extract queries from components - 3.245s
success write out requires - 0.021s
success Running gatsby-plugin-sharp.IMAGE_PROCESSING jobs - 0.470s - 34/34 72.41/s
⠀
You can now view matsubo.github.io in the browser.
⠀
  http://localhost:8000/
⠀
View GraphiQL, an in-browser IDE, to explore your site's data and schema
⠀
  http://localhost:8000/___graphql
⠀
Note that the development build is not optimized.
To create a production build, use gatsby build
⠀
success Building development bundle - 38.813s
success Writing page-data.json and slice-data.json files to public directory - 0.183s -
3/9 49.16/s