Giter Site home page Giter Site logo

Comments (3)

vish288 avatar vish288 commented on July 18, 2024 3

how do you resolve this issue, because npmrc seems to do nothing after throwing this error.
[edit] - what worked for me.
This can be sidestepped by backing up the folder and reinitializing npmrc

mv ~/.npmrcs ~/.npmrcs_bak
npmrc

This should make it working again.

from npmrc.

timoxley avatar timoxley commented on July 18, 2024

npmrc manages the symlinks for you. It will initialise things into a sensible state when you run npmrc by copying the current non-symlink ~/.npmrc into ~/.npmrcs/default and symlinking ~/.npmrc to ~/.npmrcs/default:

 ➜  ~  npmrc
 Creating /Users/conrad/.npmrcs
 Making /Users/conrad/.npmrc the default npmrc file
 Activating .npmrc 'default'

This error happens when npmrc doesn't know what to do because it expects to have been initialised i.e. it expects your ~/.npmrc to be a symlink, but it is not so it bails.

also, why? what's the benefit of it being a symlink?

It's not because of some magic property of a symlink, it's because npmrc uses symlinks to function, and if ~/.npmrc is not a symlink things are in an unknown state and npmrc doesn't know what to do. Why does npmrc use symlinks?Running things like npm config set cache-min=0 writes to ~/.npmrc. A symlink ensures you can't lose any data when changing the "current" npmrc (i.e. swapping where the symlink at ~/.npmrc points.).

from npmrc.

nwayve avatar nwayve commented on July 18, 2024

Just ran into this issue (same confusing error message) yesterday with version 1.1.1.
I followed @vish1988 's solution and got it working again.
Thanks @callumlocke for opening the issue years ago, you da real MVP.

from npmrc.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.