question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Module not found: Error: Cannot resolve 'file' or 'directory'

See original GitHub issue

Description

Deployment to Heroku fails when searching for a custom directory.

Error

remote: Failed to create a production build. Reason: remote: Module not found: Error: Cannot resolve ‘file’ or ‘directory’ …/components/layouts/main/main in /tmp/build_2382a25e2b852366900fece204e3330d/src remote: remote: npm ERR! Linux 3.13.0-95-generic remote: npm ERR! argv “/tmp/build_2382a25e2b852366900fece204e3330d/.heroku/node/bin/node” “/tmp/build_2382a25e2b852366900fece204e3330d/.heroku/node/bin/npm” “run” “build” remote: npm ERR! node v5.11.1 remote: npm ERR! npm v3.8.6 remote: npm ERR! code ELIFECYCLE remote: npm ERR! directumApp@0.1.0 build: react-scripts build remote: npm ERR! Exit status 1 remote: npm ERR! remote: npm ERR! Failed at the directumApp@0.1.0 build script ‘react-scripts build’. remote: npm ERR! Make sure you have the latest version of node.js and npm installed. remote: npm ERR! If you do, this is most likely a problem with the directumApp package, remote: npm ERR! not with npm itself. remote: npm ERR! Tell the author that this fails on your system: remote: npm ERR! react-scripts build remote: npm ERR! You can get information on how to open an issue for this project with: remote: npm ERR! npm bugs directumApp remote: npm ERR! Or if that isn’t available, you can get their info via: remote: npm ERR! npm owner ls directumApp remote: npm ERR! There is likely additional logging output above. remote: remote: npm ERR! Please include the following file with any support request: remote: npm ERR! /tmp/build_2382a25e2b852366900fece204e3330d/npm-debug.log remote: ! Push rejected, failed to compile React.js (create-react-app) multi app. remote: remote: ! Push failed remote: Verifying deploy… remote: remote: ! Push rejected to directumapp. remote: To https://git.heroku.com/directumapp.git ! [remote rejected] develop -> master (pre-receive hook declined) error: failed to push some refs to ‘https://git.heroku.com/directumapp.git

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:42 (26 by maintainers)

github_iconTop GitHub Comments

1reaction
gaearoncommented, Dec 22, 2016

It likely doesn’t install devDependencies which is where react-scripts is.

1reaction
bmbrinacommented, Oct 15, 2016

I’m using the Heroku guides specified on the project read me that was generates by Create React App. Let me see if I can share the project with you.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Webpack Error - Cannot Resolve File or Directory
I found an answer in github Error : ERROR in Entry module not found: Error: Cannot resolve 'file' or 'directory'#981. But sadly, in...
Read more >
Module not found: Error: Cannot resolve 'file' or 'directory' #6015
hello there is my webpack.config `var path = require('path'); var ExtractTextPlugin = require("extract-text-webpack-plugin"); var extractCSS ...
Read more >
Module not found: Error: Can't resolve 'file' in 'directory'
I am working on a new spark project. I used laravel shift to update 5.2 to 5.3. I registered spark and all of...
Read more >
webpack "Module not found: Error: Cannot resolve 'file' or ...
I tested the repository for Document Card web part and its working fine. I run into an issue, when my command prompt is...
Read more >
Module not found: Can't resolve 'X' error in React | bobbyhadz
To solve the "Module not found: Can't resolve" error in React, make sure to install the package from the error message if it's...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found