簡體   English   中英

流星錯誤:未捕獲錯誤:找不到模塊'component.jsx'

[英]Meteor Error: Uncaught Error: Cannot find module 'component.jsx'

我有一個絕對讓我難過的問題。

我已經開發了一個星期的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

我已經弄清楚了問題所在。 我幾天前已經重命名了一些文件,以將它們更改為與它們包含的React Components的名稱完全相同。

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

由於某種原因,github在幾個文件上沒有注意到這一變化,因此當我推送存儲庫時,我的一些導入被破壞了。

這就是為什么該應用程序可以在我的目錄中完美運行,而不在任何克隆目錄中完美運行的原因。

謝謝您的幫助

流星正在運行的實例“每次創建的文件夾”為

./meteor/Local

請刪除此文件夾。

如果您更改項目目錄,請不要保留此文件夾。 如果使用git ,請在創建gitignore文件時初始化git。在git push本地文件夾已刪除。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM