- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试将带有自定义 server.js 的 Next 应用程序部署到 GAE 中。我可以在本地甚至谷歌 GCP CLI 上毫无问题地运行该项目。现在的问题是,通过 gcloud app deploy
将应用成功部署到 GAE 后,打开应用时出现以下错误。
2020-03-30 21:41:21.748 HKT
Error: EROFS: read-only file system, unlink '/srv/dist/functions/next/BUILD_ID'
Expand all | Collapse all{
insertId: "5e81f701000b6ba4e770be02"
labels: {…}
logName: "projects/next-gae/logs/stderr"
receiveTimestamp: "2020-03-30T13:41:21.749839891Z"
resource: {…}
textPayload: "Error: EROFS: read-only file system, unlink '/srv/dist/functions/next/BUILD_ID'"
timestamp: "2020-03-30T13:41:21.748452Z"
}
我的 app.yaml 如下:
runtime: nodejs10
.gcloudignore
# This file specifies files that are *not* uploaded to Google Cloud Platform
# using gcloud. It follows the same syntax as .gitignore, with the addition of
# "#!include" directives (which insert the entries of the given .gitignore-style
# file at that point).
#
# For more information, run:
# $ gcloud topic gcloudignore
#
.gcloudignore
# If you would like to upload your .git directory, .gitignore file or files
# from your .gitignore file, remove the corresponding line
# below:
.git
.gitignore
# Node.js dependencies:
node_modules/
*.hot-update.js*
# Other config and Files
README.md
.eslintignore
.eslintrc
package.json
{
"name": "next-gae",
"version": "0.1.0",
"private": true,
"dependencies": {
"@babel/cli": "^7.8.4",
"@babel/core": "^7.8.3",
"@babel/runtime": "^7.8.7",
"@sentry/browser": "^5.15.0",
"@sentry/integrations": "^5.15.0",
"@sentry/node": "^5.15.0",
"@storybook/addon-actions": "^5.2.6",
"@storybook/addon-info": "^5.2.6",
"@storybook/addon-knobs": "^5.2.6",
"@storybook/addon-links": "^5.2.6",
"@storybook/addon-notes": "^5.2.6",
"@storybook/addon-storysource": "^5.2.6",
"@storybook/addon-viewport": "^5.2.6",
"@storybook/react": "^5.2.6",
"antd": "^3.26.7",
"axios": "^0.19.0",
"connected-react-router": "^6.5.2",
"cookie-parser": "^1.4.4",
"cors": "^2.8.5",
"date-fns": "^2.9.0",
"dotenv": "^8.2.0",
"express": "^4.17.1",
"firebase": "^7.8.0",
"firebase-admin": "^8.10.0",
"firebase-functions": "^3.3.0",
"formik": "^2.1.4",
"helmet": "^3.21.2",
"hpp": "^0.2.3",
"imagemin-optipng": "^7.1.0",
"imagemin-svgo": "^7.1.0",
"immutable": "^4.0.0-rc.12",
"isomorphic-fetch": "^2.2.1",
"js-cookie": "^2.2.1",
"morgan": "^1.9.1",
"next": "^9.1.7",
"next-antd-aza-less": "^1.0.2",
"next-optimized-images": "^2.5.5",
"next-redux-wrapper": "^4.0.1",
"nocache": "^2.1.0",
"react": "^16.12.0",
"react-dom": "^16.12.0",
"react-redux": "^7.1.3",
"react-router": "^5.1.2",
"react-smooth-scrollbar": "^8.0.6",
"react-stripe-elements": "^6.0.1",
"react-virtualized": "^9.21.2",
"redux": "^4.0.4",
"redux-devtools": "^3.5.0",
"redux-devtools-extension": "^2.13.8",
"redux-logger": "^3.0.6",
"redux-multi": "^0.1.12",
"redux-observable": "^1.2.0",
"redux-persist": "^6.0.0",
"rxjs": "^6.5.3",
"rxjs-compat": "^6.5.3",
"smooth-scrollbar": "^8.5.1",
"storybook-addon-figma": "^0.1.0",
"storybook-readme": "^5.0.8",
"styled-components": "^5.0.0",
"xss-clean": "^0.1.1",
"yup": "^0.28.2"
},
"engines": {
"node": "10"
},
"scripts": {
"test": "jest",
"flow": "flow",
"eslint": "eslint \"./**/*.{jsx,js}\"",
"lint": "eslint ./src/",
"lint:fix": "npm run lint --fix",
"lint:dry": "npm run lint --fix-dry-run",
"build-next": "next build \"src/app/\"",
"clean": "rimraf dist",
"predeploy": "npm run build-all",
"start": "cd \"src/app/\" ; NODE_ENV=production node server.js",
"deploy:gae": "npm run pre-start; npm run build-next; gcloud app deploy",
"fmt": "prettier --config .prettierrc.yml --write \"{!(node_modules),!(__mock__)/**/}*.{jsx,js,json,md,ts}\""
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"lint-staged": {
"*.{jsx,js}": [
"flow focus-check",
"npm run lint:fix",
"git add"
],
"*.{jsx,js,json,md,ts}": [
"npm run fmt",
"git add"
]
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"babel-eslint": "^10.0.3",
"babel-plugin-import": "^1.13.0",
"babel-plugin-inline-import": "^3.0.0",
"babel-plugin-inline-react-svg": "^1.1.1",
"babel-plugin-styled-components": "^1.10.6",
"babel-plugin-transform-flow-strip-types": "^6.22.0",
"cpx": "^1.5.0",
"cross-env": "^7.0.2",
"eslint": "^6.6.0",
"eslint-config-airbnb": "^18.0.1",
"eslint-config-airbnb-base": "^14.0.0",
"eslint-config-prettier": "^6.5.0",
"eslint-plugin-flowtype": "^4.4.1",
"eslint-plugin-import": "^2.14.0",
"eslint-plugin-jsx-a11y": "^6.1.2",
"eslint-plugin-prettier": "^3.1.1",
"eslint-plugin-react": "^7.16.0",
"firebase-functions-test": "^0.2.0",
"firebase-tools": "^7.15.1",
"flow-bin": "^0.111.3",
"husky": "^3.1.0",
"jest": "^24.8.0",
"lint-staged": "^9.4.2",
"nodemon": "^2.0.2",
"prettier": "^1.19.1",
"rimraf": "^3.0.2",
"webpack": "^4.42.0"
}
}
最佳答案
您收到的错误告诉您尝试删除的路径是只读的。 In GAE standard the paths you can write to are limited :
Java 8, Java 11, Node.js, Python 3.7, PHP 7.2, PHP 7.3, Ruby 2.5 (beta), Go 1.11, Go 1.12, and Go 1.13 have read and write access to the /tmp directory.
您应该处理/tmp 目录中的文件,或者如果无法执行此操作,请使用 App Engine Flex。
关于javascript - GAE 上的 NextJS - 错误 : EROFS: read-only file system,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60931998/
我已经为我的 NextJS 网站完全实现了 next-i18next。一切正常: 使用 i18next 中间件自动检测语言 使用语言选择按钮更改语言 仅在相关命名空间等中加载的翻译 但是,我想本地化路
nextjs 是如何处理 SEO 的?我试图通过从浏览器直接调用它 (localhost:8080/about) 来呈现页面,但 NGINX 返回 404。主页中嵌入的同一页面的链接有效,但无法使用
我有一个 react/nextjs 应用程序,我有 firebase.js 如下: import firebase from 'firebase/app' import 'firebase/auth'
我正在尝试将 Nextjs 与 graphql-tag/loader 集成,这是我的 next.config.js 文件: const withSass = require('@zeit/next-s
我使用的示例与文档使用的几乎相同。。我的完整代码(字面意思仅此而已):。当然,我可以使用reDirect()函数,但我需要将此重定向标记为永久重定向。。我研究了下一个/导航文件,其中没有permane
I use pretty the same example as documentation does.我使用的示例与文档使用的几乎相同。 My full code (literally no
为了部署 NodeJS,我使用 systemd 并配置/lib/systemd/system/[service_name].service 文件 ===========================
我只是尝试使用@sentry/nextjs 和 sentry 向导将 sentry 与 NextjS v12 集成,在集成 Sentry 之前在本地主机上一切正常,但是当我在 AWS Amplify
更新到 Nextjs 12.1.0 后,当我通过 api 路由调用 api 时,返回以下错误。我正在使用 aws amplify。 CloudFront 控制台返回以下错误: 我的 api 路由: c
我有一个简单的 nextjs 应用程序,在主页上我只显示一个包含 10 部电影的列表和一个按钮/链接,这会打开该电影的特定页面。在该页面上,我想显示该电影的所有内容。 我的第一种方法是像这样将电影 I
我正在开发 NextJS 应用程序,但我无法让 Image 组件正常工作。 正常的 img 元素使用与 Image 组件相同的 src 属性路径可以正常工作。 我的项目有标准的公用文件夹,里面有一个名
我是 NextJS 的新手,正在尝试弄清楚如何创建一个我可以随时分配不同值的全局变量。有人可以举一个简单的例子吗? (我知道全局可能不是最好的方法,但我仍然想知道如何设置全局变量)。 假设: _app
我有一个可通过以下 http://localhost(这是主应用程序的 url)访问的应用程序和另一个可通过 http://localhost/subapp(这是子应用程序的 url)访问的应用程序,
我在 Internet 上四处寻找解决此问题的方法,但仍未找到有效的方法。我尝试了以下状态管理工具: 使用上下文 终极版 坚持 后坐力 我希望我的 NextJS 站点在我单击一个简单按钮时更新每个页面
我在开发中发现重写代理到我的后端服务器: https://nextjs.org/docs/api-reference/next.config.js/rewrites rewrites: async (
我真的一直在努力了解如何在 nextjs 中处理环境变量,但我仍然不明白。我只是想从下面的代码中隐藏我的 API key 。据我了解,我只能通过使用 getServerSideProps 或 getS
我是 NextJS 的新手。我想知道 next/router 和 next/link 之间的典型变化和用例。 在各种情况下我应该使用哪一个?哪个做什么?例如,如果我想加载共享组件或在服务器端呈现的页面
我在 Next.js 中收到此错误: Error: The provided 'href' (/subject/[subject]) value is missing query values (su
我有外部目录 common我想将该目录中的 react 组件导入web-static .在 web-static我正在使用 nextjs。 目前我有这个错误:Module not found: Can
是否可以只为特定路由添加提供程序,而不是在下一个 js 中转到我的整个应用程序? my "pages" folder 我的上下文文件 [server.jsx] import { createConte
我是一名优秀的程序员,十分优秀!