Gulp doesn't work after reinstalling Windows - npm

Upon reinstalling Windows 10 (and Node.js), the gulp command isn't found. I ran it from my root folder containing package.json and the node_modules folder. I tried npm install gulp, and also npm install: gulp command still not found. I'm a bit puzzled.
Any idea?

do you re install node and npm again? when you re install node try with npm install -g gulp

npm install -g gulp will install gulp globally, so that you can use it as a command.
A better way to do it, is to use npm install gulp (without the -g) to install it into each local project, and fire it off using npm start scripts in each project's package.json.

Related

Error while installing expo-cli with npm and yarn

I don't know whats's wrong with my system I am trying to setup expo-cli with yarn global add expo-cli the expo init projectname doesn't work and its getting me same problem when I am trying to install with sudo npm install expo-cli --global?
This is the problem with yarn https://i.stack.imgur.com/q518S.png
&
This is the problem with npm https://i.stack.imgur.com/ojF0h.png
yarn install worked but directory where yarn puts executables for packages is not added to your PATH. If you add it there it should work.
If you want to go with npm, I would strongly recommend to never run npm install with sudo. Use tools like nvm or volta. It will install node, npm and all other packages in your home directory, it should solve all issues with permissions without giving access to your entire system.
https://github.com/nvm-sh/nvm
Try avoiding the global npm install with npx expo-cli
Alternatively, try sudo npm install -g --unsafe-perm expo-cli to install the package globally through root. This seems to be a common error with Ubuntu, more information can be found here: https://github.com/expo/expo-cli/issues/591

npm install -g -D not updating dev dependencies in package.json

I've tried opening and closing the open package.json editor, and restarting VS Code, and running and re-running the npm install command at least 8 times but to no avail.
For some reason, the command below does not update my dev dependencies in my package.json file.
$ npm install -g -D webpack
I know I can manually add the dependency but just saying and this is driving me nuts.
Your are passing the option -g which makes npm install the package globally so you can execute the binary directly, remove that flag to install the package locally.
Can you try: $ npm install --save-dev webpack
This is the recommended way to install webpack from npmjs

How to uninstall Gulp CLI from NPM globally?

I have the following package installed globally via npm:
+-- gulp-cli#2.0.1 (github:gulpjs/gulp-cli#4782b9a582ce7cc7e009073705a565b57d235332)
I have tried to uninstall it like so...
npm uninstall gulp-cli#2.0.1
But it does not remove it. How can I get this package removed from my global location?
I'm on npm version 6.1.0
Thanks to R. Wanjohi I figured it out for my machine. I had to do the following to get the global version of gulp cli off my machine:
npm rm -g gulp-cli
I was experiencing the same problem but when I used the following code, it worked:
npm rm -g gulp
You need to uninstall it globally (add the -g tag)
npm uninstall -g gulp-cli#2.0.1
Here is the npm docs: https://docs.npmjs.com/cli/uninstall.html
it's pretty simple, to uninstall a global package run
npm uninstall -g <package-name>
to verify run
npm ls -g --depth=0
for short videos

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

Installing/Using Bower on Uberspace with NPM

Hi I use uberspace and installed ghost there. Ghost uses npm.
If I try:
npm install -g bower
It doesn't install it and throws a lot of erros messages what makes sense because the server is shared between many users.
sudo npm install -g bower
Tells me that it doesn't know bower
If I install it locally with
npm install bower
It installs it to ../node_modules. But using for example
bower install angular-mailchimp
Throws the error:
-bash: bower: command not found
How do I get it running?
I was able to get Bower installed in the correct place by prefixing the global install with the following command.
npm install -g --prefix=$HOME bower