Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in "/var/www/html/node_modules/gatsby-plugin-robots-txt/gatsby-node.js": Cannot find module 'fs/promises' #606

Open
emarubi opened this issue May 20, 2022 · 0 comments

Comments

@emarubi
Copy link

emarubi commented May 20, 2022

Hi,
I'm trying to run a two-years old gatsby project, and I have this error on build:

`#14 0.657 $ gatsby build
#14 5.021 Environment set: production
success open and validate gatsby-configs - 0.131s

#14 7.253 ERROR
#14 7.253
#14 7.253 Error in "/var/www/html/node_modules/gatsby-plugin-robots-txt/gatsby-node.js":
#14 7.253 Cannot find module 'fs/promises'
#14 7.253 Require stack:
#14 7.253 - /var/www/html/node_modules/gatsby-plugin-robots-txt/gatsby-node.js
#14 7.253 - /var/www/html/node_modules/gatsby/dist/bootstrap/resolve-module-exports.js
#14 7.253 - /var/www/html/node_modules/gatsby/dist/bootstrap/load-plugins/validate.js
#14 7.253 - /var/www/html/node_modules/gatsby/dist/bootstrap/load-plugins/load.js
#14 7.253 - /var/www/html/node_modules/gatsby/dist/bootstrap/load-plugins/index.js
#14 7.253 - /var/www/html/node_modules/gatsby/dist/services/initialize.js
#14 7.253 - /var/www/html/node_modules/gatsby/dist/services/index.js
#14 7.253 - /var/www/html/node_modules/gatsby/dist/bootstrap/index.js
#14 7.253 - /var/www/html/node_modules/gatsby/dist/commands/build.js
#14 7.253 - /var/www/html/node_modules/gatsby-cli/lib/create-cli.js
#14 7.253 - /var/www/html/node_modules/gatsby-cli/lib/index.js
#14 7.253 - /var/www/html/node_modules/gatsby/dist/bin/gatsby.js
#14 7.253 - /var/www/html/node_modules/gatsby/cli.js
#14 7.253
This is my package.json

"scripts": {
"build": "gatsby build",
"develop": "gatsby develop",
"clean": "gatsby clean",
"lint": "eslint --fix src .js",
"start": "node server.js",
"serve": "gatsby serve",
"test": "echo "Write tests! -> https://gatsby.dev/unit-testing\"",
"storybook": "NODE_ENV=production start-storybook -s ./public -p 49999",
"storybook:build": "NODE_ENV=production build-storybook -c .storybook -o storybook_public/ -s ./static && cp -r public/static storybook_public"
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"lint-staged": {
"
.js": [
"eslint --fix",
"git add"
]
},
"dependencies": {
"@babel/core": "^7.5.5",
"@babel/runtime": "^7.5.5",
"@bugsnag/js": "^6.3.2",
"@bugsnag/plugin-react": "^6.2.0",
"@storybook/addons": "^5.0.11",
"@storybook/components": "^5.0.11",
"autoprefixer": "^9.6.1",
"bugsnag": "^2.4.3",
"classnames": "^2.2.6",
"core-js": "^2",
"dotenv": "^8.0.0",
"dotenv-webpack": "^1.7.0",
"eslint-plugin-graphql": "^3.0.3",
"event-source-polyfill": "^1.0.5",
"express": "^4.17.1",
"gatsby": "^2.13.44",
"gatsby-image": "^2.2.7",
"gatsby-plugin-i18n": "^1.0.1",
"gatsby-plugin-jss": "^2.1.3",
"gatsby-plugin-manifest": "^2.2.13",
"gatsby-plugin-offline": "2.2.9",
"gatsby-plugin-react-helmet": "^3.1.2",
"gatsby-plugin-react-redux": "^1.0.10",
"gatsby-plugin-remove-trailing-slashes": "^2.1.4",
"gatsby-plugin-robots-txt": "^1.5.0",
"gatsby-plugin-sharp": "^2.2.17",
"gatsby-plugin-sitemap": "^2.2.3",
"gatsby-plugin-styled-jsx": "^3.1.2",
"gatsby-source-apiserver": "^2.1.3",
"gatsby-source-contentful": "^2.1.15",
"gatsby-source-filesystem": "^2.1.16",
"gatsby-transformer-sharp": "^2.2.11",
"graphql-tag": "^2.10.1",
"hoist-non-react-statics": "^3.3.0",
"intersection-observer": "^0.7.0",
"keyboard-focus": "^1.0.1",
"lodash": "^4.17.15",
"markdown-it": "^9.1.0",
"path-to-regexp": "^3.0.0",
"picturefill": "^3.0.3",
"postcss-js": "^2.0.2",
"prop-types": "^15.7.2",
"ptz-i18n": "^1.0.0",
"react": "^16.8.6",
"react-dom": "^16.8.6",
"react-helmet": "^5.2.1",
"react-jss": "^10.0.0-alpha.23",
"react-redux": "^7.1.0",
"redux": "^4.0.4",
"redux-act": "^1.7.7",
"redux-devtools-extension": "^2.13.8",
"redux-saga": "^1.0.5",
"regenerator-runtime": "^0.13.2",
"seamless-immutable": "^7.1.4",
"styled-jsx": "^3.2.1",
"webpack-bugsnag-plugins": "^1.4.0"
},
"devDependencies": {
"@babel/plugin-proposal-decorators": "^7.4.4",
"@babel/plugin-proposal-optional-chaining": "^7.2.0",
"@storybook/addon-a11y": "^5.0.10",
"@storybook/addon-actions": "^5.0.3",
"@storybook/addon-console": "^1.1.0",
"@storybook/addon-notes": "^5.0.3",
"@storybook/addon-viewport": "^5.0.10",
"@storybook/react": "5.2.0-alpha.30",
"@storybook/theming": "^5.0.5",
"babel-loader": "^8.0.6",
"babel-preset-gatsby": "^0.2.8",
"eslint-config-airbnb": "^17.1.1",
"eslint-config-prettier": "^6.0.0",
"eslint-config-react-app": "^4.0.1",
"eslint-plugin-prettier": "^3.0.1",
"eslint-plugin-react-hooks": "^1.6.1",
"husky": "^3.0.2",
"lint-staged": "^9.2.1",
"prettier": "^1.18.2",
"storybook-addon-react-docgen": "^1.2.1"
}
`
I know that dependencies need to be updated, but I was told by CTO to not make any updates for the moment.
I'm running node 12.20 in a docker container.

Thanks for your help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant