mam ten kawałek reagują kod nazywany main.js
:browserify nie może znaleźć modułu 'reagować'
var React = require('react');
var Comment = React.createClass({
render: function(){
return (
<div className="comment">
<h2 className="commentAuthor">
{this.props.author}
</h2>
<span dangerouslySetInnerHTML={{__html:marked(this.props.children.toString(), {sanitize:true})}} />
</div>
);
}
});
I staram się używać browserify i reactify z nim:
browserify -t reactify main.js
Ale Otrzymuję ten błąd:
Error: Cannot find module 'react' from '/Users/jameslin/projects/reactjs/react-0.13.2'
at /usr/local/lib/node_modules/browserify/node_modules/resolve/lib/async.js:46:17
at process (/usr/local/lib/node_modules/browserify/node_modules/resolve/lib/async.js:173:43)
at ondir (/usr/local/lib/node_modules/browserify/node_modules/resolve/lib/async.js:188:17)
at load (/usr/local/lib/node_modules/browserify/node_modules/resolve/lib/async.js:69:43)
at onex (/usr/local/lib/node_modules/browserify/node_modules/resolve/lib/async.js:92:31)
at /usr/local/lib/node_modules/browserify/node_modules/resolve/lib/async.js:22:47
at Object.oncomplete (fs.js:107:15)
Biorąc pod uwagę, że mam zainstalowany react
i reactify
KMP moduły według:
npm install -g react
npm install -g reactify
ale dlaczego? (morecharacterstopost) – Sebastialonso