Node.js + Webpack + Typescript = ENOENT: no such file or directory, open ‘//package.json’

As the node_module I need doesn’t have a @types repo, I tried to import it and I got this:

Error: ENOENT: no such file or directory, open '//package.json'

My .ts

import * as IWatermark from 'image-watermark';

When I import this module the Webpack insert this code into the bundle.js:

exports = module.exports = {
  embedWatermark: embedWatermark,
  embedWatermarkWithCb: embedWatermarkWithCb,
  version: JSON.parse(
    __webpack_require__(22).readFileSync(__dirname + '/package.json', 'utf8')).version
};

And then it tries to load my package.json with this path //package.json.

How do I properly load a non-typescript module into my typescript code?

Do I need a specific configuration for resolving this?

OBS: It’s Webpack 2


Source: stackoverflow-javascript