Skip to content

Linked packages can't be found during build #1130

@bertday

Description

@bertday

Can you reproduce the problem with latest npm?

Yes. I'm on Node 7.2.0, npm 3.10.9.

Description

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:

  1. npm ls react-scripts (if you haven’t ejected):

    [email protected] /home/ubuntu/workspace/atlas-mapbook
    └── [email protected]

  2. node -v: v7.2.0

  3. npm -v: 3.10.9

Then, specify:

  1. Operating system: Ubuntu 16.04 on Cloud9; NVM preinstalled
  2. Browser and version: n/a

Reproducible Demo

https://github.com/rbrtmrtn/create-react-app-issue

Thanks for any suggestions!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions