流星错误:未捕获错误:找不到模块' component.jsx'

时间:2017-01-03 20:27:00

标签: javascript meteor npm

我遇到的问题一直困扰着我。

我有一个Meteor / React应用我已经开发了一个星期。我桌面上的一切运行正常。我今天抓起我的MacBook,从Github取出代码然后去运行它。

应用程序在JavaScript控制台中抛出错误:

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)

我将应用程序克隆到桌面上的新文件夹中,我也遇到了同样的问题。我已经删除了对Signin.jsx模块的所有引用,但我也得到了其他模块的错误。

我不知道造成这种情况的原因,该应用程序在我的原始开发目录中运行良好,但只要我将其拉入新目录,我就会在JS控制台中收到此错误。

我试过了:

meteor reset
meteor npm rebuild
meteor npm install
meteor update

他们都没有任何区别。非常感谢您的帮助!

修改

当我在新目录中运行meteor npm install时,我收到以下可能与此问题有关的错误?

> 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

2 个答案:

答案 0 :(得分:0)

我已经弄明白问题是什么。我几天前重命名了一些文件,将它们更改为与它们包含的React组件的名称完全相同。

所以例如 - 我重命名了signin.jsx - > Signin.jsx

出于某种原因,github并没有注意到这几个文件的变化,所以当我推动回购时,我的一些进口产品被打破了。

这就是为什么应用程序在我的目录中完美运行但不在任何克隆目录中的原因。

感谢您的帮助

答案 1 :(得分:0)

Meteor运行实例每次创建的文件夹

  

./流星/本地

请删除此文件夹。

如果您的更改项目目录,请不要使用此文件夹。如果使用 git ,则在创建gitignore文件的时候初始化git。这在git push Local Folder Removed。

相关问题