-1

I am new to angular, I want to run an angular project that uses angular- cli version 1.0.0-beta.24.

I tried uninstalling the current npm version, clean cache and than npm install -g angular-cli@1.0.0-beta.24. but it doesn't work. I am using node version 0.35.1

I have installed node -v v6.0.0 and nvm doesnt work

Sarabjeet
  • 15
  • 7

1 Answers1

1

Usually when you are downgrading/upgrading Angular projects you have to make sure that Angular CLI version matches Angular version and Typescript version. More details here

In your case if you are downgrading to 1.0.0-beta.24 you have to use NodeJS v6.x and make sure you are using Typescript v2.0.x

Also, when downgrading versions, make sure you removed node_modules folder and package-lock.json or yarn.lock files if you have any in your project. Then run npm i or yarn to pull the old packages.

If you are having issues switching NodeJS versions try NVM

UPDATE:
The error you are getting might be related to connectivity issues. If you are behind the proxy try that:

npm config set proxy http://your.company.proxy.com:port
npm config set https-proxy http://your.compny.company.com:port
angularrocks.com
  • 26,767
  • 13
  • 87
  • 104
  • The github link in the above referred link doesnt not work. i used this link https://nodejs.org/dist/latest-v6.x/ and downloaded file node-v6.17.1-linux-x64.tar.gz i still have 0.35.1 version. I tried curl -sL https://rpm.nodesource.com/setup_6.x | bash and i get an error can't create transaction lock on /var/lib/rpm/.rpm.lock i know its because of the sudo rights and i dont have admin permission on my system. Is there any other way it can be done or can you point me to the rights link or resource. Thanks – Sarabjeet Feb 19 '20 at 01:14
  • `>The github link in the above referred link doesn't not work` - what link? – angularrocks.com Feb 19 '20 at 01:26
  • @Sarabjeet Just updated the answer with the link to NVM, that should help. – angularrocks.com Feb 19 '20 at 01:38
  • i have installed node version but nvm doesnt work and angular command also doesnt work to install the beta can u please check the attached screenshot in the question. – Sarabjeet Feb 23 '20 at 14:41
  • this is the package.json file{ "version": "3.8.6", "name": "npm", "description": "a package manager for JavaScript", "keywords": [ "install", "modules", "package manager", "package.json" ], "preferGlobal": true, "config": { "publishtest": false }, "homepage": "https://docs.npmjs.com/", "author": "Isaac Z. Schlueter (http://blog.izs.me)", "repository": { "type": "git", "url": "https://github.com/npm/npm" }, – Sarabjeet Feb 23 '20 at 14:46
  • for my project which is on angular 1.0.0-beta.24, package.json looks like this{ "name": "package.json", "version": "0.1.2", "license": "MIT", "angular-cli": {}, "scripts": { "ng": "ng", "start": "ng serve --host 0.0.0.0 --proxy-config proxy.conf.json", "build": "ng build --env=prod --base-href=/paper-archive/ --prod --aot=false", "lint": "tslint \"src/**/*.ts\"", "test": "ng test", "pree2e": "webdriver-manager update --standalone false --gecko false", "e2e": "protractor" }, – Sarabjeet Feb 23 '20 at 14:49
  • @Sarabjeet The error you are getting saying there is a problem with connectivity. Are you behind the proxy? - if so see my update on the answer. – angularrocks.com Feb 23 '20 at 23:19
  • is it not required to have the nvm to install angular version the jar file for v6.0.0 has only npm and node – Sarabjeet Feb 23 '20 at 23:29
  • @Sarabjeet yes nvm is not required but it is gives you a flexible way of switching between node versions, it is useful when migrating projects like in your case, that is why I recommend that. Can you confirm you bypass the proxy? – angularrocks.com Feb 23 '20 at 23:33
  • got it and the package.json file versions also differ i hope thats not an issue i am just trying it now – Sarabjeet Feb 23 '20 at 23:40
  • please check the screenshot attached i think its still the same issue with proxy and i also dont have sudo access – Sarabjeet Feb 23 '20 at 23:56
  • @Sarabjeet you should find out your company proxy name – angularrocks.com Feb 23 '20 at 23:59
  • @kunevic Thanks a lot i have done the proxy settings and than i did npm install -g express (as i was getting error package.json missing) and than npm install -g angular-cli@1.0.0-beta.24 than i did ng version ---angular-cli 1.0.0-beta24....Finally...i hope my steps are correct but thanks a lot...i will now try to run my angular project and see what happens. – Sarabjeet Feb 24 '20 at 12:32
  • Error while running the project. []$ng serve You have to be inside an ember-cli project in order to use the serve command. []$npm start > ng serve --host 0.0.0.0 --proxy-config proxy.conf.json You are running version 6.0.0 of Node, which will not be supported in future versions of the CLI. The official Node version that will be supported is 6.9 and greater. To disable this warning use "ng set --global warnings.nodeDeprecation=false".** NG Live Development Server is running on http://0.0.0.0:4200. ** Hash: b8a000d32e50ae915dc8 Time: 26019ms – Sarabjeet Feb 24 '20 at 15:57
  • chunk {0} 0.chunk.js, 0.chunk.js.map 30.1 kB {1} {2} {3} {4} [rendered] chunk {1} 1.chunk.js, 1.chunk.js.map 34.5 kB {0} {2} {3} {4} [rendered] chunk {2} 2.chunk.js, 2.chunk.js.map 36.6 kB {0} {1} {3} {4} [rendered] chunk {3} 3.chunk.js, 3.chunk.js.map 35.8 kB {0} {1} {2} {4} [rendered] chunk {4} main.bundle.js, main.bundle.js.map (main) 710 kB {7} [initial] [rendered] chunk {5} styles.bundle.js, styles.bundle.js.map (styles) 295 kB {8} [initial] [rendered] webpack: Compiled successfully. – Sarabjeet Feb 24 '20 at 15:57
  • @Sarabjeet do you still have any issues? – angularrocks.com Feb 24 '20 at 21:50