Can I run npm package using yarn without installing that package? - npm

Using npm you can use not locally installed package (missing in local node_modules) like this
npx #angular/cli ng new
which will install cli to the cache and use it (node_modules in project are intact)
can I do this with yarn ??

Related

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

Gulp doesn't work after reinstalling Windows

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.

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

Failure to install packages after setting yarn to package manager

Im trying to setup a new project with angular cli and have set my package manger like this:
ng set --global packageManager=yarn
However, when I try to create a new angular project with cli, I get this
Installing packages for tooling via yarn.
'yarn' is not recognized as an internal or external command,
operable program or batch file.
Package install failed, see above.
Package install failed, see above.
So then I start looking to see if I have yarn even installed and I do this:
D:\devsrc>npm list -g --depth=0
and get this:
C:\Users\me\AppData\Roaming\npm
+-- #angular/cli#1.3.1
+-- angular-cli#1.0.0-beta.28.3
`-- typescript#2.2.2
npm ERR! peer dep missing: rxjs#^5.0.1, required by #angular/core#2.4.10
npm ERR! extraneous: tsickle#0.2.5 C:\Users\
How can I have 2 different versions of angular cli installed?
How can I clean this up and get Yarn installed?
So first thing, you are getting 'yarn' is not recognized as an internal or external command error is because you do not have yarn globally installed run
npm install yarn -g to fix that
Second you have two #angular/cli#1.3.1 and angular-cli#1.0.0-beta.28.3 packages is because the angular cli package name has being changed since version 1.0.0-beta.28.3. Before it was angular-cli now it is #angular/cli so just uninstall the old one uninstall angular-cli -g. After that you might need to reinstall the latest one npm install #angular/cli -g

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