Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import private module from npm registiry #23800

Closed
Horki opened this issue May 14, 2024 · 9 comments
Closed

Import private module from npm registiry #23800

Horki opened this issue May 14, 2024 · 9 comments

Comments

@Horki
Copy link

Horki commented May 14, 2024

What is a proper way to include private module that I own on private npm registry?

Is there a way to integrate my npm account with deno? I couldn't find in documentation how to do that

package.json

{
  "name": "deno_run",
  "version": "1.0.0",
  "description": "using private npm reg",
  "scripts": {
    "dev": "deno run --allow-env --allow-sys main.ts"
  },
  "dependencies": {
    "@ivan/my-private-module": "42.0.1",
    "uuid": "9.0.1"
  }
}

I receive response
npm package '@ivan/my-private-module' does not exist.

@bartlomieju
Copy link
Member

Are you using .npmrc to define your registry configuration?

@Horki
Copy link
Author

Horki commented May 15, 2024

@bartlomieju
Hi, I have copied .npmrc with registry info into root of project, and still nothing
EDIT:
I have also tried, with same effect
NPM_CONFIG_REGISTRY=https://registry.npmjs.org/:_authToken=npm_myPrivateToken deno run main.ts

@bartlomieju
Copy link
Member

@Horki .npmrc is not yet supported, but we are working on it in #23560.

Please follow #16105 for updates.

@Horki
Copy link
Author

Horki commented May 16, 2024

@bartlomieju Hi, is there any way to include npm private modules? ... and how?

@bartlomieju
Copy link
Member

@Horki not currently no, please follow the linked issue and PR above. Once they land it will be supported just like with npm - using .npmrc file.

@jtibble
Copy link

jtibble commented May 28, 2024

@bartlomieju Hi, I have copied .npmrc with registry info into root of project, and still nothing EDIT: I have also tried, with same effect NPM_CONFIG_REGISTRY=https://registry.npmjs.org/:_authToken=npm_myPrivateToken deno run main.ts

This now works correctly in the canary builds @Horki !

@Horki
Copy link
Author

Horki commented May 29, 2024

Hi @jtibble I have tried with deno 1.43.6+a947c6f built, and it is not working

@jtibble
Copy link

jtibble commented May 29, 2024

Hi @jtibble I have tried with deno 1.43.6+a947c6f built, and it is not working

Make sure you run like DENO_FUTURE=1 deno run main.ts to enable the .npmrc feature

@bartlomieju
Copy link
Member

That's correct. DENO_FUTURE=1 is required to enable .npmrc support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants