【发布时间】:2017-05-18 00:47:35
【问题描述】:
我遇到了一个让我非常难过的问题。
我已经开发了一周的 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
【问题讨论】:
-
你确定大小写正确吗? `'../../ui/components/signin/Signin.jsx' 仔细检查您的 import / require 语句是否使用确切的大写字母作为实际文件。您还可以在导入该组件的位置发布一段代码吗?
-
是的,外壳是完美的。该应用程序在我正在开发的原始目录中 100% 完美运行,只有当我将它克隆到一个新目录时它才会中断(这让我认为问题与 node_modules 文件夹有关,因为它没有被推送到github。检查我的编辑!
-
在运行 npm install 之前,请删除 .meteor 文件夹中的本地文件夹。
-
我想通了,谢谢你们的帮助
标签: javascript meteor npm