Skip to content

Install via NPM/Yarn fails #2

@tecfu

Description

@tecfu

To repeat:

npm install philsturgeon/API-flow --save-dev
const ApiFlow = require('api-flow').default; // if from yarn/npm
const path = require('path');
const options = {
    source: {
        format: 'swagger',
        version: 'v2.0'
    },
    target: {
        format: 'raml',
        version: 'v1.0'
    }
}

const promise = ApiFlow.transform({
  options,
  uri: path.resolve(__dirname, './my_super_swagger.yml')
})

promise.then((data) => {
  // do some cool stuff with the data
})

Result:

Error: Cannot find module '/myproject/node_modules/api-flow/dist/node/api-flow.js'. Please verify that the package.json has a valid "main" entry

Why?

You don't add a build step in package.json, so dist/node/api-flow.js is never created.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions