简体   繁体   中英

Meteor Error: Uncaught Error: Cannot find module 'component.jsx'

I have a problem that has absolutely stumped me.

I've got a Meteor/React application I've been developing for a week. Everything is running fine on my desktop. I grabbed my MacBook today, pulled the code from Github and went to run it.

The app throws the error in the JavaScript console:

modules-runtime.js?hash=637cb12…:139

Uncaught Error: Cannot find module '../../ui/components/signin/Signin.jsx'
    at Function.require.resolve (modules-runtime.js?hash=637cb12…:139)
    at Module.resolve (modules-runtime.js?hash=637cb12…:91)
    at Module.Mp.import (printer.js:170)
    at meteorInstall.imports.startup.client.routes.jsx (routes.jsx:1)
    at fileEvaluate (modules-runtime.js?hash=637cb12…:191)
    at Module.require (modules-runtime.js?hash=637cb12…:116)
    at Module.Mp.import (printer.js:170)
    at meteorInstall.imports.startup.client.index.js (index.js:1)
    at fileEvaluate (modules-runtime.js?hash=637cb12…:191)
    at Module.require (modules-runtime.js?hash=637cb12…:116)

I cloned the application to a new folder on my desktop and I get the same problem there too. I've removed all references to the Signin.jsx module but I just get the error thrown for other modules too.

I have no idea what is causing this, the app works perfectly in my original development directory but as soon as I pull it in to a new directory I get this error in the JS console.

I have tried:

meteor reset
meteor npm rebuild
meteor npm install
meteor update

None of them have made any difference. Your help is much appreciated!

EDIT

When I run meteor npm install in the new directory I get the following error that may have something to do with the problem?

> bcrypt@1.0.2 install /Users/s/Desktop/calendar/node_modules/bcrypt
> node-pre-gyp install --fallback-to-build

node-pre-gyp ERR! Tried to download(404): https://github.com/kelektiv/node.bcrypt.js/releases/download/v1.0.2/bcrypt_lib-v1.0.2-node-v46-darwin-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for bcrypt@1.0.2 and node@4.6.2 (node-v46 ABI) (falling back to source compile with node-gyp)
xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance

xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance

  CXX(target) Release/obj.target/bcrypt_lib/src/blowfish.o
  CXX(target) Release/obj.target/bcrypt_lib/src/bcrypt.o
  CXX(target) Release/obj.target/bcrypt_lib/src/bcrypt_node.o
  SOLINK_MODULE(target) Release/bcrypt_lib.node
clang: warning: libstdc++ is deprecated; move to libc++ with a minimum deployment target of OS X 10.9
  COPY /Users/s/Desktop/calendar/node_modules/bcrypt/lib/binding/bcrypt_lib.node
  TOUCH Release/obj.target/action_after_build.stamp

I've figured out what the problem was. I had renamed some files a few days ago to change them to be exactly the same as the name of the React Components they contained.

So for example - I renamed signin.jsx -> Signin.jsx

For some reason, github didn't notice this change on a few files so when I pushed the repo, some of my imports were broken.

That's why the app worked perfectly in my directory but not in any cloned directories.

Thanks for the help

Meteor Running Instance Everytime Created Folder is

./meteor/Local

Please Delete this Folder .

If Your Change Project Directory,Don't Kepp this Folder. If Using git ,initialaize git at the time created gitignore file created .This During git push Local Folder Removed .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM