I am trying to setup jenkins job for Angular cli project. I am getting 406 error. This stuff works in my local. The issue is only when I run from jenkins. Can someone please guide me here.
npm ERR! node v6.6.0
npm ERR! npm v4.1.2
npm ERR! code E406
npm ERR! Registry returned 406 for GET on http://myRepository.com:someport/artifactory/blahblah/#angular%2fcommon
Yes, you need Node > 6.9 and npm > 3.0 for angular CLI.
Verify that you are running at least node 6.9.x and npm 3.x.x by
running node -v and npm -v in a terminal/console window. Older
versions produce errors, but newer versions are fine.
source: https://angular.io/guide/quickstart
Related
I an having issue regarding the installation of expo on the new mac.
When I run this command:
npm install --global expo-cli
I have the error:
npm ERR! code EACCES
npm ERR! syscall access
npm ERR! path /usr/local/lib/node_modules
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, access '/usr/local/lib/node_modules'
npm ERR! [Error: EACCES: permission denied, access '/usr/local/lib/node_modules'] {
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'access',
npm ERR! path: '/usr/local/lib/node_modules'
npm ERR! }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/theowatine/.npm/_logs/2020-11-21T09_26_14_033Z-debug.log
Does anyone know what could be the solution? Thank you for your help!
This is a common issue when using a globally-installed npm. The npm docs contain a page about it.
They recommend reinstalling node/npm with a version manager (like nvm). This is often a very good option if you are developing something locally. If you do that, this problem will go away. You can stop reading this answer if you want.
They also provide a way to configure npm to put the globally installed items in a directory of your choosing. That is a good option too, if a version manager won't work for you for whatever reason.
Another option they mention is using npx instead of globally installing the tool. I use this one a lot and like it quite a bit, but it does mean that you frequently have to remember to prefix commands you see with npx.
There are two somewhat common options that they do not list. One is to run your install with sudo. This means that any lifecycle scripts will get run as root on your machine. This is generally a bad idea (which is why they don't mention it in the docs), but is very common.
Another option is to chmod your /usr/local/lib/node_modules directory such that you can write to it. This is also a not-great idea in my opinion (which is probably why it too is not mentioned in the docs), but people do it.
In the case of expo-cli and in most developing-something-locally cases, installing with a package manager like nvm is probably the way to go.
I am also using macOS Big Sur on mbp and i experienced same issue. After reading Trott's answer i downloaded node from https://nodejs.org/en/download/ and installed it. Now expo and react native working fine.
Homebrew version of node is failed to install expo at all time but direct download from nodejs.org worked fine.
try this:
sudo npm install -g expo-cli
I am using Big sur(11.4) and I have downloaded latest version of node
https://nodejs.org/en/download/
Then run the following command for install expo and its working fine.
npm install --global expo-cli
My latest Google Cloud Builds are failing with the following error:
Step 3/16 : RUN npm i
---> Running in 9b3b8df05c12
npm notice
npm notice New patch version of npm available! 7.0.2 -> 7.0.3
npm notice Changelog: <https://github.com/npm/cli/releases/tag/v7.0.3>
npm notice Run `npm install -g npm#7.0.3` to update!
npm notice
npm ERR! Maximum call stack size exceeded
The last successful build was on October 17th. Since then, I have only made one commit which changed some typescript. Nothing in the dockerfile or NPM dependencies has changed.
The relevant section of the Dockerfile looks like this:
FROM node AS minifier
COPY MyProject/Client .
RUN npm i
RUN npm install -g grunt-cli rollup
RUN grunt release
It looks like the issue is specifically with the RUN npm i command. Is this a bug? Is there anything I can do to fix it? I did retry the build, but encountered the same error.
This is an issue caused due to the latest release of npm i.e. v7.0.3. There are multiple alternatives to this:
You can change the base image to node:15.0.0 or node:15.0.0-slim
Alternatively using yarn instead of npm can also fix this issue
Run npm cache clean --force before npm i in your Dockerfile
I'd recommend changing the base image.
In my case, the root problem is a slow internet connection to the npm registry. After I changed to another npm registry, the problem was never triggered.
I get this error message when I run npm start:
Cannot read property 'map' of undefined
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! quote-react-redux#0.1.0 start: `react-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the quote-react-redux#0.1.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
Anyone have an idea of what is going on? Or is there any documentation to read npm error logs as well?
I have gotten similar errors, ie. to reproduce one of mine:
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! gatsby-starter-default#0.1.0 develop: `gatsby develop`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the gatsby-starter-default#0.1.0 develop script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
The problem occurs when I am running a different version of node than the one I used to either generate the app with, or perhaps was cloned from elsewhere and forgot to run npm install.
Fix 1: Change the node version to the same version the app was generated with in the directory you are trying to launch the server via your node version manager.
Fix 2: Make sure you have the node version you want to run set in the directory you are working in, then npm install. You may want to do this in an new git branch, until you get it running, then merge into master, as sometimes if the versions were really different you may need to manually install additional packages (they will be listed).
Fix 3: Clear out and start from scratch (probably better than Fix 2). Try:
npm cache clean --force
rm package-lock.json
/bin/rm -rf node_modules/
npm install
I have installed nodejs version 5.0.0 and npm 3.3.6 on my MacBook pro. Every time i try to install ionic i get the following error:
npm ERR! Darwin 15.0.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "ionic"
npm ERR! node v5.0.0
npm ERR! npm v3.3.6
npm ERR! code ECONNRESET
npm ERR! errno ECONNRESET
npm ERR! syscall read
How can i fix this ?
After reading the Cordova API CLI requirements on OSX. i found out that i need the have all iOS SDK tools which is part of XCode installation.
Cordova CLI requirements for OSX:
http://cordova.apache.org/docs/en/5.1.1/guide/platforms/ios/index.html
So this is the steps to get Ionic up and running on OSX ElCapitan 10.11.1 and to fix the issue i had earlier:
1) Download and then Install XCode on your OSX.
2) Run the following command in your terminal:
sudo npm install -g cordova ionic
3) You will be able to install both Cordova and Ionic on your machine with no errors as it was showing earlier.
4) Try to create a project to validate everything is good to go in the terminal window:
ionic start mostafaApp1 tabs
You will find that the project has been created successfully.
Hope this helps.
I use to have the exact same error.
In the Installation Guide from ionic (http://ionicframework.com/docs/v2/getting-started/installation/) explains that you need a Node.js version 6 or greater to install ionic.
I fixed it by upgrading my Node.js to the current version "v6.8.0", and then my installation from ionic work without errors! :)
You can download the latest version from Node.js from the official website: "https://nodejs.org/en/"
I followed this tutorial to install yeoman, bower, grunt to setup angularjs corodva project. http://www.sitepoint.com/kickstart-your-angularjs-development-with-yeoman-grunt-and-bower/
as it says i installed everything but still it gives me error! while creating angular project.
I did,
My PC is running windows 8.1 64 bit
Install node.js using windows installer (64 bit)
Install git (selected windows commandline instead git bash while installing)
npm install -g yo grunt-cli bower
I cross checked everything whether it is installed
C:\Windows\system32>yo --version && grunt --version && bower --version
yo - 1.4.7
grunt-cli v0.1.13
bower - 1.4.1
4. npm install -g generator-angular
created a dir in c and installed yo angular
C:\test\yo angular
It asked for sass (i given NO), bootstrap (YES), other angularjs library (NO) then it started installing
then after sometime, it asks that my package.json should overwrite i gave yes
after the few files generated then shows ERR!
npm ERR! tar.unpack untar error /root/.npm/wrappy/1.0.1/package.tgz
npm ERR! tar.unpack untar error /root/.npm/wrappy/1.0.1/package.tgz
npm ERR! tar.unpack untar error /root/.npm/brace-expansion/1.1.0/package.tgz
npm ERR! tar.unpack untar error /root/.npm/delayed-stream/0.0.5/package.tgz
npm WARN optional dep failed, continuing form-data#0.1.4
npm ERR! tar.unpack untar error /root/.npm/is-property/1.0.2/package.tgz
npm WARN optional dep failed, continuing request#2.54.0
As Prasanth says, The best way is to do the following:
npm cache clean
double checked whether everything is installed
also try close then re-open cmd as administrator
When angular asks for overwrite package.json, Say n to all
Still faces issue, then try this
make sure Grunt is installed
npm install (it will install missing packages)