天道酬勤,学无止境

Force npm download from private registry

Question

In my nodejs project I had to modify 4 of the node modules and upload them to our private corporate registry so the project will download the modified versions during builds. I did this by changing the resolved field in package-lock.json for each dependency from our virtual npm registry which forwards downloads to the public npm registry to our private registry.

This is working for 3 out of the 4 modules, however 1 module, phantomjs-prebuilt, will not download the one I uploaded. When I view its package.json after installing, its _resolved field shows the correct private registry I entered in package-lock.json, but the module doesn't have my modifications.

If I create a test project with a package.json that has phantomjs-prebuilt as its only dependency and modify the lock file to download from the private registry it will download the correct modified version I uploaded. I'm assuming there must be some transitive dependency overriding it, but I thought I would be able to see that from the lock file and override it. phantomjs-prebuilt only appears once in my lock file and that's where I'm making the change to the resolved field.

Restricted HTML

  • Allowed HTML tags: <a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd> <h2 id> <h3 id> <h4 id> <h5 id> <h6 id>
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.

相关推荐
  • Not able to install @angular/cli using npm
    Question I am new to "@angular/cli", I have tried every thing but could not install. I am tired now please some one can help me to install angular 4 "@angular/cli" in my system. node and npm Version and when I am installing "npm install -g @angular/cli" then getting after installing node -v 6 I am getting below erorr please suggest me where actually I am wrong. Answer1 My friend, Please try: npm cache clean --force. Maybe your npm cache got confused. Answer2 It could be issue with your node version. I will suggest you to reinstall node and try it again. Or you can also try to clean node cache
  • nvm & npm tutorial
    nvm It is recommended to use nvm for node version management, and it is more convenient to switch between multiple versions. What | what node version manager-node version management tool, you can switch multiple versions of node at the same time to run locally. How | How to use 1. Install nvm Take curl as an example, open a terminal, copy and paste the following commands, and press Enter to wait for the installation to complete. curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.3/install.sh | bash 2. Install node.js Use the nvm install <version> [<arch>] command to download the
  • Create a vue project (vue+elementUI+vuex+vue-router+axios) vue family bucket
    1. First create a folder where you want to put the project 2. Click to enter the folder and enter cmd 3. Check whether there is an environment in the black window first, check the node environment: node -v, check vue-cli: vue -V or vue -list, if the version number comes out, it proves that it already exists and does not need to be installed If not, download node.js and install it first Then use Taobao NPM Mirror $ npm install -g cnpm --registry=https://registry.npm.taobao.org Install vue-cli, command: cnpm install vue-cli -g //install vue-cli globally After the environment has 4. Enter the
  • When I run `npm install`, it returns with `ERR! code EINTEGRITY` (npm 5.3.0)
    Question I am getting this error while running sudo npm install. On my server, npm was installed earlier. I've tried to delete the package-lock.json file, and ran npm cache clean --force, but it didn't work. My npm version is 5.3.0. The error: npm ERR! code EINTEGRITY npm ERR! sha512-MKiLiV+I1AA596t9w1sQJ8jkiSr5+ZKi0WKrYGUn6d1Fx+Ij4tIj+m2WMQSGczs5jZVxV339chE8iwk6F64wjA== integrity checksum failed when using sha512: wanted sha512-MKiLiV+I1AA596t9w1sQJ8jkiSr5+ZKi0WKrYGUn6d1Fx+Ij4tIj+m2WMQSGczs5jZVxV339chE8iwk6F64wjA== but got sha512-WXI95kpJrxw4Nnx8vVI90PuUhrQjnNgghBl5tn54rUNKZYbxv
  • Installation/upgrade/downgrade of node.js on linux/window, and cnpm instead of npm
    table of Contents Linux installation Create node storage path folder Test whether the installation is successful Use Taobao's cnpm instead of npm window install Download and install msi from the official website Verification: node-v npm -v Configure npm's global module cache Configure environment variables NODE_PATH \node_global\node_modules D: \ szw \ the \ node \ node_global \ Configure Taobao as the domestic mirror source npm promotion/downgrade node up/down Common commands npm upgrade package.json dependency package to the latest version number Linux installation Create node storage path
  • VUE (1)-Install vue-cli2 and vue-cli3 scaffolding and create a project
    1. Install nodejs Enter nodejs official website: http://nodejs.cn/download/ Double-click to install after downloading Check whether the installation is complete, win+R -> cmd -> Enter, enter the following command (it seems that you don’t need to configure environment variables, if you enter the following command prompt "...not an internal command...", please configure the environment variables) 2. Install vue-cli2 scaffolding 1. Understand npm and cnpm npm (node ​​package manager) is a nodejs package manager for node plugin management (including installation, uninstallation, dependency
  • Steps to install the new version of Appium
    Before installing Appium, you must install JDK, Maven, SDK, Node and configure their corresponding environment variables (Node does not need to configure environment variables). For the installation of these software and environment configuration, please Baidu yourself. Prerequisite: If you have an old version of Appium, you must uninstall the old version of Appium, or you can’t install the new version of Appium. Steps: win+r--input cmd--click OK--enter the cmd command line window below After all the commands are running, there is a pause, just click Enter -----------important 1. Upgrade the
  • 'npm install' extremely slow on Windows
    Question For me is npm install extremely slow. I'm using Windows 8.1 with the latest npm version. My connection speed is around 100Mbit/s. The project I'm trying to install has around 20 packages/dependencies and it takes around 30 Minutes to install all dependencies ... Does anyone have a clue? Answer1 I ran into the same problem, using --verbose as peterh mentioned showed me the source of the problem: I am behind a proxy, which uses its own certificates for https-connections. According to user "Mletter1" on https://github.com/npm/npm/issues/8872 the issue is quite easily solved by using http
  • Nodejs private npm server selection
    npm-we all know that it is a package management tool for NodeJS, which is used to manage Node plugins including installation, uninstallation, and dependency management. Based on the npm command line, we can quickly install the code modules that the project depends on, and even publish some self-written plug-ins. So that our project development efficiency has been greatly improved.So what can we do based on npm?Simply put:One-line command, (batch) install modules written by othersOne line of command, uninstall the installed moduleOne line of command, update to the latest (or specified version)
  • Yarn && npm set the mirror source
    安装yarn npm i -g yarn yarn yarn config set registry https://registry.npm.taobao.org --global && \ yarn config set disturl https://npm.taobao.org/dist --global && \ yarn config set sass_binary_site https://npm.taobao.org/mirrors/node-sass --global && \ yarn config set electron_mirror https://npm.taobao.org/mirrors/electron/ --global && \ yarn config set puppeteer_download_host https://npm.taobao.org/mirrors --global && \ yarn config set chromedriver_cdnurl https://npm.taobao.org/mirrors/chromedriver --global && \ yarn config set operadriver_cdnurl https://npm.taobao.org/mirrors/operadriver -
  • How do you install angular-cli for windows 7
    Question I am trying to install angular-cli for windows. I know the command is npm install -g angular-cli, however once I run this command I then try to do ng new however I get an error saying "ng is not a recognized command" I checked the other questions on here saying that you have to add the folder to the PATH variable, however when I check in the folder I've tried to install angular-cli into I don't even see anything. Here you can see I've installed the angular-cli using the provided command and that any use of the "ng" command registers and error: And here you can see an empty folder with
  • Private and Public NPM Package Install in Single Command
    Question I have a few npm package listed in package.json file , some are public and some are private. I want to install both types of packages in single command by using npm install. If npm registry set on global, private package shows 404, so how to achieve this by single command.I want Both types of package install on node_modules. Answer1 The faster solution is what @hugomarisco suggested in the comment section. I'll assume your private package is in any registry (A) and the remainings are fetched from npmjs (B). To make it more clear, you can use verdaccio and set up your multiples
  • Solve various npm install errors
    Write in front First check your own node version, my own node (12.18.3) Universal solution--basics 1. Update the latest NPM portal (npm: npm install npm -) 2. Taobao change source (npm install -g cnpm --registry=https://registry.npm.taobao.org) 3. Delete the node_modules folder, re-npm insatll (if it doesn't work, use cmd ⇒ cnpm install) 4. Clear the cache (npm cache clean --force) 1. npm install reports an error directly // 相信我,请参照万能解决方案 1,2 2. The node-sass installation failed Allow me to make a complaint first. There is a sentence in my mind that MMP is not a good thing to say. Case study
  • npm ERR! Unexpected end of input at 1:379680
    Question I recently installed the latest version of nodejs i.e v8.1.3 and I am using windows 10 After that, i wanted to install the cordova and ionic packages so I ran the command npm install -g ionic cordova after running this command I am getting the below error! I am fed up as this error isn't available in Google search also yet. This is the error log I am getting on the cmd console npm ERR! Unexpected end of input at 1:379680 npm ERR! .1","osenv":"~0.1.3","path-is inside":"~1.0.1","read":"~1.0.7","read- npm ERR! ^ npm ERR! A complete log of this run can be found in: npm ERR! C:\Users
  • npm local install fails on first try
    Question Background I have package.json with a bunch of development dependencies. I use local install i.e. npm install with my package.json node -v v0.10.26 npm -v 1.4.4 Windows 7 x32bit Problem On fresh first try with no ./node_modules present (i.e. fresh) I get various errors. Some of them are related to npm_cache and locks saying that I need to run as Administrator. Why? Why does the subsequent npm install succeeds. Questions Why should subsequent install should succeed ? I am not interested why they fail - there could be various reasons and perhaps each need to be dealt with well. Can
  • Elasticsearch- install the visual management plug-in head
    1). Download the head plugin elasticsearch-head-master.zip:https://github.com/mobz/elasticsearch-head 2). Download nodejs node-v6.9.2-linux-x64.tar.gz: https://nodejs.org/dist/ 3). Upload to the /opt/software directory of the master node. 4). Install nodejs [dendan@master software]$ tar -zxvf node-v6.9.2-linux-x64.tar.gz -C /opt/module/ 5). Configure nodejs environment variables [root@master software]# vi /etc/profile Additional content: export NODE_HOME=/opt/module/node-v6.9.2-linux-x64 export PATH=$PATH:$NODE_HOME/bin Reload profile [root@master software]# source /etc/profile 6) View node
  • How to install a private NPM module without my own registry?
    Question I've taken some shared code and put it in an NPM module, one I don't want to upload to the central registry. The question is, how do I install it from other projects? The obvious way is probably to set up my own NPM registry, but according to the documentation, that involves a lot of hassle. Can I just install an NPM module that sits on the local filesystem, or perhaps even from git? npm install --from-git git@server:project Answer1 cd somedir npm install . or npm install path/to/somedir somedir must contain the package.json inside it. It knows about git too: npm install git://github
  • Solve the problem that create-react-app is unusually slow when creating a react project
    When creating a react project for the first time through create-react-app or through a compiler such as webstorm, there are many related packages to be installed, and the installation of these packages is basically installed internally through npm. Since npm is very stuck when accessing some foreign resources, sometimes even if a VPN is opened, the creation process may be very slow at this time. In fact, we can use domestic data sources. After some attempts, I found a blog of a great god (https://www.uedbox.com/post/8151/) that can solve the above problems. Through the second solution he
  • Node, Vue, React development environment construction
    Node, Vue, React development environment construction System: macOS 10.13.6 Reference document: https://www.runoob.com/nodejs Install nodejs Download nodejs Official website download address: https://nodejs.org/en/ For most developers, it is recommended to download the LTS version of nodejs installation Just next all the way, and finally remember the installation path of Nodejs and npm as follows. verification Enter node -v and npm -v in the terminal to display the version number, which means the installation is successful basic concepts What is Node.js Node.js is a running environment based
  • How to delete an npm package from the npm registry?
    Question Is there a possible way to remove or delete the entire module from npm registry? Notice: npm -f unpublish doesn't allowed you to unpublish anything older than 24 hours Answer1 There's a post about that, given the recent incident. Your best bet would be to contact npm and hope that your package isn't depended by other projects. If the version is older than 24 hours, then the unpublish will fail, with a message to contact support@npmjs.com. If you contact support, they will check to see if removing that version of your package would break any other installs. If so, we will not remove it