I am attempting to install Angular CLI in an offline environment using cache. The approach I am using is
1. copy the npm-cache folder from %appdata% folder ( from my online machine which has Angular already installed)
2. Place it in my offline machine.
3. Run this command to install angular cli from cache:
npm i #angular/cli -g --cache MY_CACHE_FOLDER --cache-min 999999999 --no-shrinkwrap
I receive the following error:
FetchError: request to https://registry.npmjs.org/#angular%2fcli failed, reason: connect ECONNREFUSED 104.16.22.35:443
My question is, why is npm trying to look online, when I specified to use cache?
Related
I have published a package to the Gitlab NPM registry and now I am attempting to install the package into another project.
When I run in terminal:
yarn add #org-name/project or npm i #org-name/project
I get (4x):
info There appears to be trouble with the npm registry (returned undefined). Retrying…
Then after the 4 attempts above in the terminal I get:
ResponseError: Request failed “503 Service Unavailable”
I have authed to Gitlab and the group as I was able to publish the package and followed each step here: https://docs.gitlab.com/ee/user/packages/npm_registry
Any ideas at all as to why I can publish but not download the same package from the same repo or any other repo??
Thank you so very much in advance!
The issue turned out to be a typo on my part. Le sigh.
I am currently using npm task in my build pipeline in azure devops.
Recently the npm run step started failing with below error. When I manually install the sass and sass-loader the npm run step passes without any error. How can I install the complete modules from pipeline.?
ERROR in Module build failed (from ./node_modules/#angular-devkit/build-angular/node_modules/sass-loader/lib/loader.js):
You can try the following ways to see if the problem can be solved:
Execute the npm install command to install the node-sass (see here) in the pipeline.
npm install -D node-sass
Reconfigure your npm package on the local machine.
Install or upgrade Angular to the latest version.
Check out the source repository to the local machine.
Remove the nose modules and the package lock.
Reinstall the refresh dependencies for your package via the npm isntall command.
Push the changes to the remote repository, then try the pipeline.
I have fixed the issue by adding another step with npm task and passed and argument(sass-loader) to install the sass modules.
I was trying to figure out how local cache is fitted in npm install flow. I did the following:
npm cache clear --force
npm cache rd
npm install react#16.10.1
I disconnected from the internet
I removed the node_modules directory
npm install react#16.10.1
The package got installed and a package-lock.json was created successfully; however the following warning in the console made me confused:
Using stale data from https://registry.npmjs.org/ because the host is inaccessible -- are you offline?
npm WARN registry Using stale data from https://registry.npmjs.org/ due to a request error during revalidation.
...
...
Why did npm try to connect to the registry at all while the package does exist in the local cache? and
What was npm trying to get from the registry? Did it try to download the whole package or it just wanted to check some metadata like hash or so?
I use npm to install new component built by ReactJs. I can successfully install it on local windows machine. However, when I tried to use AWS codeBuild to build my client project, I encountered the following error in virtual machine:
npm ERR! Maximum call stack size exceeded
My npm version is 6.4.1.
When the build starts, the build process actually download npm and start to install packages based on package.json. So it is like to install packages on brand new machine.
I've tried to search online to see if there is anything similar and I couldn't find any solution.
Just plain 'npm install'
I want to install latest electron version in my existing angular application.So I followed npm command to install it.
Command : npm i electron#latest
Expected Behavior
Electron should installed successfully.
Actual Behavior
So, Whenever I tried to install electron, after downloading zip file and SAMSUN.txt file , it is throwing below error....
Error: Generated checksum for "electron-v2.0.2-win32-x64.zip" did not match expected checksum.
at ChecksumMismatchError.ErrorWithFilename (E:\CityLawElectron\node_modules\electron-download\node_modules\sumchecker\build.js:41:124)
at new ChecksumMismatchError (E:\CityLawElectron\node_modules\electron-download\node_modules\sumchecker\build.js:56:133)
at Hash. (E:\CityLawElectron\node_modules\electron-download\node_modules\sumchecker\build.js:203:22)
at emitNone (events.js:106:13)
at Hash.emit (events.js:208:7)
at emitReadable_ (_stream_readable.js:513:10)
at emitReadable (_stream_readable.js:507:7)
at addChunk (_stream_readable.js:274:7)
at readableAddChunk (_stream_readable.js:250:11)
at Hash.Readable.push (_stream_readable.js:208:10)
Please note that I have tried to clear my npm cache using npm cache clean --force command and tried to install. but it didn't work.
I also tried to install electron globally using npm i -g electron#latest, but that approach also didn't work.
Please provide solution as soon as possible because I m really stuck at this problem.
Electron Version: 2.0.2
Operating System : windows
node version : 8.11.2
npm version : 6.1.0
Last known working Electron version:
We can solve this issue by using following steps (OS - Windows 10)
Delete "SHASUMS256.txt-x.x.xx" file from "C:\Users{{UserName}}.electron".
Delete Cache folder from "C:\Users{{UserName}}\AppData\Local\electron".
Delete electron from node_modules folder.
Then install electron globally and locally by using following commands -
npm init -y //Note: The -y flag provides default options automatically
npm install electron -g //install electron globally
npm install electron --save-dev --save-exact //install electron as devdependencies
If you are using typescript then install it as global using below command-
npm install -g typescript
Above steps may help you.