ethanselzer / react-cursor-position

A React component that decorates its children with mouse and touch coordinates relative to itself.
https://ethanselzer.github.io/react-cursor-position
MIT License
143 stars 35 forks source link

example site cannot run npm start #11

Closed bdefore closed 7 years ago

bdefore commented 7 years ago

Off of a fresh npm install with either node 6.2.1 or 7.4.0 I get the following error:

Module not found: Can't resolve '../pkg-lnk/ReactCursorPosition' in '/Users/d4/code/react-cursor-position/example/src/components'

ethanselzer commented 7 years ago

Hi @bdefore, Thanks for opening this issue. I'm sorry you are having trouble building the project. You state that you are attempting to run the example site "off of a fresh npm install". I think this might be the problem. The NPM package, which is what is installed on your computer when you run npm install, does not contain the example site. The example site is in the source project on GitHub. See the example site instructions on on the project readme. Please let me know if this does or does not correct the problem.

bdefore commented 7 years ago

@ethanselzer I am running the steps from those instructions exactly, cloning, moving to example directory, npm installing and trying to start. i'm not installing the react-cursor-position package via npm.

ethanselzer commented 7 years ago

I'm sorry I missunderstood. Thanks for clarifying. I think I know what the problem is now. The symlink, named "pkg-lnk", which you called out in your original post, contains an absolute path, which is only valid on my computer. I will try to create a symlink containing a relative path, or I will eliminate it and reference the package from node_modules. I'll post here when this is done. Thanks for uncovering my mistake! I really appreciate it.

ethanselzer commented 7 years ago

@bdefore I think the problem you identified is fixed with this commit. In my testing the example project built and ran without issue. Along with making the symlink, named pkg-lnk, a relative path, I also updated the example project instructions because they were incomplete. Please let me know if it does or does not work for you. I apologize for the trouble and for misreading your initial post. Thanks again for bringing this issue to my attention! ~Ethan

bdefore commented 7 years ago

@ethanselzer ah of course, i should have had a look at pkg-lnk that would have identified the cause. i can confirm your change fixes things - i'm able to yarn start and move about the demo site. thanks!