node-modules - Gatsby 项目在开发中有效,但在部署时出现错误(netlify,zeit)
问题描述
我的 gatsby 项目有这样的结构:
Project
node_modules
plugins
gatsby-source-cloud // Local Plugin with code from scratch
node_modules
gatsby-node.js
package.json
utis.js
public
src
gatsby-config.js // Here one of the plugins resolve to the local plugin above
gatsby-node.js
package.json
这段代码在开发环境中完美运行,但是在部署到github后尝试投入生产(netlify,zeit)时,抛出错误:
嵌套在本地插件 (plugins/gatsby-source-cloud/gatsby-node.js) 中的 gatsby-node.js 在嵌套的 node_modules (pugins/gatsby-source-cloud/node_modules) 中找不到一个模块。
解决方案
您无法部署 Gatsby 源代码。您必须运行gatsby build
和部署 HTML、CSS 和 JS 的输出。
推荐阅读
- r - How to convert 3 hourly data into hourly data?
- php - 带有附件的邮件没有通过邮件到达?
- javascript - 从最后一个点(。)之前替换字符串
- python - Cloud Bigtable:当我按列过滤时,我的修改请求是原子的吗?
- sql-server - 从sql server中的字符串获取模式匹配的子字符串
- node.js - NODE_ENV 不是内部或外部命令、可运行程序或批处理文件
- express-gateway - Express-Gateway 中的 Oauth2 密码授予类型
- android - 强制android textview保持单行
- powerbi - 不同表中的 Power BI sumif 函数具有多对多关系
- mysql - 在查询中查询以在 MySQL Select 中通过多个连接获取特定值