8000 When installed with yarn: Cannot find module 'convert-units/definitions/all' · Issue #311 · convert-units/convert-units · GitHub
[go: up one dir, main page]

Skip to content

When installed with yarn: Cannot find module 'convert-units/definitions/all' #311

@addiks

Description

@addiks

Hello,

I want to use the new Version 3.0 of the convert-units module because I need a couple of custom units, but the sample Code from the README seems broken. I installed the module with yarn add convert-units@beta:

yarn add v1.22.19
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
warning " > react-dom@16.13.1" has incorrect peer dependency "react@^16.13.1".
warning "sprotty > snabbdom-virtualize@0.7.0" has incorrect peer dependency "snabbdom@~0.6.6".
[4/4] Building fresh packages...
success Saved 1 new dependency.
info Direct dependencies
└─ convert-units@3.0.0-beta.6
info All dependencies
└─ convert-units@3.0.0-beta.6
Done in 4.14s.

And tried to use the sample code from the README (I even commented out all other code for testing purposes):

import { configureMeasurements } from 'convert-units';
import allMeasures from 'convert-units/definitions/all';

But while the first line works, the second one generates this error:

$ yarn tsc
yarn run v1.22.19
$ tsc && webpack
ts/widgets/placement_map.ts:7:25 - error TS2307: Cannot find module 'convert-units/definitions/all'.

7 import allMeasures from 'convert-units/definitions/all';
                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Found 1 error.

error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

How can I resolve this issue?
Thank you for any replies.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0