在我的CRA中使用绝对路径时,在heroku上构建步骤失败。
我的.env.local文件中有以下内容:
``` NODE_PATH=src/ ```
我还在我的heroku设置中使用了这个环境变量。我尝试在heroku上使用“heroku-postbuild”脚本构建我的应用程序(它只运行“react-scripts build”)。我使用一个express服务器来提供这个构建文件夹并代理请求到各种API。
这是我得到的错误:
``` remote: Running heroku-postbuild (yarn) remote: yarn run v1.14.0 remote: $ react-scripts build remote: Creating an optimized production build... remote: Failed to compile. remote: remote: ./src/app/App.js remote: Cannot find module: 'checklist/Checklist'. Make sure this package is installed. remote: remote: You can install this package by running: yarn add checklist/Checklist. remote: remote: error Command failed with exit code 1. ```
Checklist.js文件位于“src/checklist/Checklist.js”。
有什么办法可以让这个工作?
我的.env.local文件中有以下内容:
``` NODE_PATH=src/ ```
我还在我的heroku设置中使用了这个环境变量。我尝试在heroku上使用“heroku-postbuild”脚本构建我的应用程序(它只运行“react-scripts build”)。我使用一个express服务器来提供这个构建文件夹并代理请求到各种API。
这是我得到的错误:
``` remote: Running heroku-postbuild (yarn) remote: yarn run v1.14.0 remote: $ react-scripts build remote: Creating an optimized production build... remote: Failed to compile. remote: remote: ./src/app/App.js remote: Cannot find module: 'checklist/Checklist'. Make sure this package is installed. remote: remote: You can install this package by running: yarn add checklist/Checklist. remote: remote: error Command failed with exit code 1. ```
Checklist.js文件位于“src/checklist/Checklist.js”。
有什么办法可以让这个工作?