我正在尝试将这个react组件添加到我的流星项目中:https://github.com/dancormier/react-native-swipeout
我添加了标准的browserify/npmhack进程。当我在之后运行这个应用程序时,我会收到以下错误:
Marks-MacBook-Air:meteor-app markshust$ meteor --settings settings/dev.json
[[[[[ ~/Sites/meteor-app ]]]]]
=> Started proxy.
=> Started MongoDB.
npm-container: updating npm dependencies -- react-native-swipeout, externalify...
=> Errors prevented startup:
While processing files with cosmos:browserify (for target web.browser):
lib/app.browserify.js: Unexpected token (53:6) while parsing file:
/Users/markshust/Sites/meteor-app/packages/npm-container/.npm/package/node_modules/react-native-swipeout/index.js
While processing files with cosmos:browserify (for target os.osx.x86_64):
lib/app.browserify.js: Unexpected token (53:6) while parsing file:
/Users/markshust/Sites/meteor-app/packages/npm-container/.npm/package/node_modules/react-native-swipeout/index.js
=> Your application has errors. Waiting for file change.当我拉起https://github.com/dancormier/react-native-swipeout/blob/master/index.js的第53行时,它碰到了一些jsx。该文件名为.js后缀,因此当它运行到jsx代码时,它似乎遇到了问题。
我假设这是一个常见的问题,当使用反应组件从npm与流星。如何轻松地解决这一问题?
非常感谢!标记
packages.json
{
"react-native-swipeout": "2.0.8",
"externalify": "0.1.0"
}lib/app.browserify.js
Swipeout = require('react-native-swipeout');lib/app.browserify.options.json
{
"transforms": {
"externalify": {
"global": true,
"external": {
"react": "React.require"
}
}
}
}发布于 2016-06-11 13:04:58
本机??快速输出对等依赖响应??本机,因此您需要在packages.json或package.js中添加Npm.depends。
流星1.3仍然使用node0.10,但react本机需要节点0.12,因此,反应-本机-快速流星需要等待流星1.4的使用
$MONGO_VERSION = "2.6.7“
$NODE_VERSION = "0.10.45“
$NPM_VERSION = "2.15.1“
$PYTHON_VERSION = "2.7.10“
https://stackoverflow.com/questions/32786503
复制相似问题