728x90
반응형
netlify 에서 배포 중 아래와 같이 에러가 시작되며 배포가 fail을 반복하고 있었음.
netlify 의 기본 node 버전은 12버전인듯 한데 이때문에 아래와 같은 오류가 시작됨.
Cannot find module ‘fs/promises’
2:43:42 PM: ────────────────────────────────────────────────────────────────
2:43:42 PM: 1. Build command from Netlify app
2:43:42 PM: ────────────────────────────────────────────────────────────────
2:43:42 PM:
2:43:42 PM: $ gatsby build
2:43:45 PM: success open and validate gatsby-configs - 0.078s
2:43:47 PM: error Error in "/opt/build/repo/node_modules/gatsby-plugin-robots-txt/gatsby-node.js": Cannot find module 'fs/promises'
2:43:47 PM: Require stack:
2:43:47 PM: - /opt/build/repo/node_modules/gatsby-plugin-robots-txt/gatsby-node.js
2:43:47 PM: - /opt/build/repo/node_modules/gatsby/dist/bootstrap/resolve-module-exports.js
2:43:47 PM: - /opt/build/repo/node_modules/gatsby/dist/bootstrap/load-plugins/validate.js
2:43:47 PM: - /opt/build/repo/node_modules/gatsby/dist/bootstrap/load-plugins/load.js
2:43:47 PM: - /opt/build/repo/node_modules/gatsby/dist/bootstrap/load-plugins/index.js
2:43:47 PM: - /opt/build/repo/node_modules/gatsby/dist/services/initialize.js
2:43:47 PM: - /opt/build/repo/node_modules/gatsby/dist/services/index.js
2:43:47 PM: - /opt/build/repo/node_modules/gatsby/dist/bootstrap/index.js
2:43:47 PM: - /opt/build/repo/node_modules/gatsby/dist/commands/build.js
2:43:47 PM: - /opt/build/repo/node_modules/gatsby-cli/lib/create-cli.js
2:43:47 PM: - /opt/build/repo/node_modules/gatsby-cli/lib/index.js
2:43:47 PM: - /opt/build/repo/node_modules/gatsby/dist/bin/gatsby.js
2:43:47 PM: - /opt/build/repo/node_modules/gatsby/cli.js
2:43:47 PM:
2:43:47 PM:
2:43:47 PM: Error: Cannot find module 'fs/promises'
2:43:47 PM: Require stack:
2:43:47 PM: - /opt/build/repo/node_modules/gatsby-plugin-robots-txt/gatsby-node.js
2:43:47 PM: - /opt/build/repo/node_modules/gatsby/dist/bootstrap/resolve-module-exports.js - /opt/build/repo/node_modules/gatsby/dist/bootstrap/load-plugins/validate.js
2:43:47 PM: - /opt/build/repo/node_modules/gatsby/dist/bootstrap/load-plugins/load.js
2:43:47 PM: - /opt/build/repo/node_modules/gatsby/dist/bootstrap/load-plugins/index.js
2:43:47 PM: - /opt/build/repo/node_modules/gatsby/dist/services/initialize.js
2:43:47 PM: - /opt/build/repo/node_modules/gatsby/dist/services/index.js
2:43:47 PM: - /opt/build/repo/node_modules/gatsby/dist/bootstrap/index.js
2:43:47 PM: - /opt/build/repo/node_modules/gatsby/dist/commands/build.js
2:43:47 PM: - /opt/build/repo/node_modules/gatsby-cli/lib/create-cli.js
2:43:47 PM: - /opt/build/repo/node_modules/gatsby-cli/lib/index.js
2:43:47 PM: - /opt/build/repo/node_modules/gatsby/dist/bin/gatsby.js
2:43:47 PM: - /opt/build/repo/node_modules/gatsby/cli.js
해결 : 프로젝트 최상단 경로에 .nvmrc 파일을 생성하고 그 안에 버전 명을 기재한 후에 배포함
참조
https://answers.netlify.com/t/build-error-in-remix-app-with-prisma-seed-file/52594/3
반응형
'Tech' 카테고리의 다른 글
올해 속 썩였던 블루스크린 (0) | 2022.07.26 |
---|---|
기가바이트(Gigabyte) 보드 - 일정 시각에 자동 부팅 설정 (0) | 2022.06.19 |
npm 모듈 버전 확인 (0) | 2022.06.06 |
윈도우 메모리 관련 정보 얻기 (0) | 2022.05.11 |
윈도우 갓모드 (0) | 2022.05.01 |