search

Home  >  Q&A  >  body text

javascript - Installing cnpm keeps getting errors


I had cnpm installed on my machine before, but I didn’t use it for a while. This time, I couldn’t execute the command in cnpm -v. I even deleted the previous node. I downloaded it again, please help me.

为情所困为情所困2747 days ago642

reply all(2)I'll reply

  • 滿天的星座

    滿天的星座2017-05-16 13:41:36

    After uninstalling cnpm with npm, reinstall cnpm. But I think the best way is to add --registry=https://registry.npm.taobao.org after the npm command every time. Although it is a little troublesome, it is very stable and not too troublesome.

    reply
    0
  • 曾经蜡笔没有小新

    曾经蜡笔没有小新2017-05-16 13:41:36

    No need for cnpm, just use npm.
    Directly modify the npm warehouse address:

    npm config set registry https://registry.npm.taobao.org

    At this time, the .npmrc file will be created in the user folder of the c drive (it is the configuration file of npm), and inside it is registry=https://registry.npm.taobao.org/
    You can use npm directly in the future.

    reply
    0
  • Cancelreply