Skip to content

Naming collision when installing punycode via npm #79

@pdehaan

Description

@pdehaan

I'm using Node 9.7.1, and have [email protected] installed (via $ npm i punycode -S), but when I try and log out the punycode.version variable, I always seem to get "2.0.0", so I think my machine is still using the default/bundled/deprecated version of https://nodejs.org/api/punycode.html

How can you install this module from npm and use it in Node 8+ without it using the built-in version of the punycode module? It looks like I can use the npm version if I do something like require("./node_modules/punycode"), but that feels wrong.

$ node -e "console.log(require('punycode').version)" # 2.0.0
$ node -e "console.log(require('./node_modules/punycode').version)" # 2.1.0
$ node --version # v9.7.1

$ node -e "console.log(require.resolve('punycode'))" # punycode
$ node -e "console.log(require.resolve('./node_modules/punycode'))" # /Users/pdehaan/dev/tmp/node_modules/punycode/punycode.js

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