jialinhuang00 / Debugging

0 stars 0 forks source link

Review the npm #4

Open jialinhuang00 opened 6 years ago

jialinhuang00 commented 6 years ago
>npm root -g
C:\Users\Jiaaa\AppData\Roaming\npm\node_modules

>npm config get prefix
C:\Users\Jiaaa\AppData\Roaming\npm
>npm config set prefix C:\\Users\\Jiaaa\\global
>npm root -g
C:\Users\Jiaaa\global\node_modules
>npm init
This utility will walk you through creating a package.json file.
It only covers the most common items, and tries to guess sensible defaults.

See `npm help json` for definitive documentation on these fields
and exactly what they do.

Use `npm install <pkg>` afterwards to install a package and
save it as a dependency in the package.json file.
jialinhuang00 commented 6 years ago

Nodejs uninstalled and reinstalled...

jialinhuang00 commented 6 years ago

before this action, we have package.json in our working place.

npm i -g create-react-app

just like Angular

>npm install -g @angular/cli

npm WARN @schematics/angular@0.1.10 requires a peer of @angular-devkit/schematics@0.0.40 but none is installed. You must install peer dependencies yourself.
npm WARN @schematics/schematics@0.0.10 requires a peer of @angular-devkit/schematics@0.0.40 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.3 (node_modules\@angular\cli\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

to solve the shit above

@angular-devkit/schematics@0.0.40
jialinhuang00 commented 6 years ago

-g flag is important!

if installing something that dosen't use -g will create at your cmd working place.

jialinhuang00 commented 6 years ago

Cancel Post 1 content, that's totally a mess

nodejs 中的 NODE_PATH

jialinhuang00 commented 6 years ago

list the packages already installed.

npm -g ls --depth=0