You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm working on two projects at the same time, both generated with create-react-app. One exports a React component that's used by the other, so I'd like create a symlink between the two. I ran npm link within the master project and then npm link mapbook (where mapbook is the name of the project) in the client. Then in index.js for the client I have:
import Mapbook from 'mapbook'
Expected behavior
When I run npm run start, I'm expecting the module to be imported without any errors.
Actual behavior
Instead I get:
Error in ./src/index.js
Module not found: 'mapbook' in /home/ubuntu/workspace/atlas-mapbook/src
Not sure why it's not seeing the symlink in node_modules. If I change the import/export statements to CommonJS and simply node index.js it works fine, so I don't think it's a permissions issue.
Environment
Run these commands in the project folder and fill in their results:
There is no good support for npm link workflow at the moment.
There are a few issues about this and we’ll need to consider a holistic solution at some point.
Activity
joserobleda commentedon Dec 1, 2016
I guess CRA default settings doesn't makes babel to transpile anything with a realpath outside your project.
I'm also looking for a solution to this situation. I found a workaround by ejecting, but I really don't want to..
rmx90210 commentedon Dec 2, 2016
@joserobleda interesting. What did you do after you ejected?
gaearon commentedon Dec 5, 2016
There is no good support for
npm linkworkflow at the moment.There are a few issues about this and we’ll need to consider a holistic solution at some point.
gaearon commentedon Dec 5, 2016
Closing in favor of #1107, let's consolidate
npm linkdiscussion and use cases there.