Gulp-cli version is not updating - npm

I've updated gulp from v 3.9.0 to 4.0.0. When I run gulp i get error Cannot read property 'apply' of undefined. I've read that this is because of gulp-cli version 3.9.0 and I need to update to 2.1.0
On my local machine i've got all to work, and the versions are:
CLI Version: 2.1.0
Local Version: 4.0.0
But on our dev-server the CLI-version won't change and it's stuck at 3.9.0.
I have uninstalled both gulp and gulp-cli, removed the node_modules folder. Installed it again and it's the correct versions in the package.json.
"gulp": "^4.0.0",
"gulp-cli": "^2.1.0",
But when i run gulp -v now it still outputs CLI Version: 3.9.0..
Someone familiar with this? gulp 3.9.0 is globally installed on the server, can this cause the problem?

First uninstall your current versions of Gulp and Gulp CLI:
npm uninstall gulp --save-dev
npm uninstall gulp -g
then go ahead and reinstall Gulp version 4.0.0:
npm install gulp-cli -g
npm install gulp#4.0.0

Related

How can I install a specific NativeScript version?

Im trying to install the tns 6.7.4 version, but I just get the 7.1.2 version.
I tried to do:
sudo npm uninstall -g nativescript
sudo npm cache clean --force
sudo npm install -g nativescript#6.7.4
I also tried with nativescript#6 and also with nativescript#6.7 but everything ends with the 7.1.2 version.
The command npm i -g nativescript will install the NativeScript CLI. It won't update/migrate your existing project. However, once you have installed a specific version of the CLI, you can use it to create new projects with the related versions.
For example
npm uninstall -g nativescript
npm i -g nativescript#5.4.0
tns --version // will output 5.4.0
Once you have the wanted version of the CLI you can create a project that uses the core dependencies

create-react-app not working not after upgrading npm and nodejs

I upgraded npm and nodejs to 6.14.4 and 12.16.3 resp. Getting below error while creating react app using create-react-app.
According to readme:
If you've previously installed create-react-app globally via npm
install -g create-react-app, we recommend you uninstall the package
using npm uninstall -g create-react-app to ensure that npx always uses
the latest version.
So resolved the problem using command:
npx create-react-app contactmanager

how to downgrade angular-cli 1.7.3 to angular-cli 1.6.8

I am getting issue in my Ubuntu regarding reinstalling of angular.
my current version:
Angular 1.7.3
Node: 8.11.1
OS: Linux
Angular: 4.4.4
I want to reinstall from angular 1.7.3 to angular 1.6.8
Please help..
Correct command now is this:
npm uninstall -g angular-cli
npm cache clean --force
npm install #angular/cli#1.6.8
The key here is first # before angular and angular/cli not angular-cli.
You can uninstall the current version of angular cli- 1.7.3 and install 1.6.8
npm uninstall -g angular-cli
npm cache clean
npm install -g angular-cli#1.6.8

npm install result in an incomplete module, but yarn install is successful, why they behave differently?

I tried npm install and npm install --no-optional for my forked repository, and it was not installed completely: git+https://github.com/marsonmao/react-sketch#v0.4.104 (link).
After using npm install, only part of the repository was installed: there are only /node_modules and .eslintrc, karma.config.js, README.md...etc in MyProject/node_modules/react-sketch, but no /lib and /src...etc.
Then I tried yarn install and it was successful, every file in the repository was installed.
So why npm failed however yarn succeeded?
npm version: 5.5.1, yarn version: 1.3.2

Demo using Aurelia- can not install jspm

I following this link https://github.com/rmourato/Mvc5-Aurelia
I can not install jspm and run project
I already install nodejs
Can anyone help me on this.
Next to nodejs (which installs npm) you also need to install gulp and jspm.
So change into the Mvc5-Aurelia/Aurelia directory and run:
npm install
npm install -g gulp
npm install -g jspm
More details here: https://github.com/rmourato/Mvc5-Aurelia/tree/master/Mvc5-Aurelia/Aurelia under Running the App
After that you can run gulp watch