Can I install npm to any directory?

for example, my project is wamp64/www/blog under d disk. Should I change to this directory when I install npm and then install it?
how can I make a mistake when I execute npm run dev after executing the following sentence? I wanted to create a vue project using cli. vue init webpack blog was executed before, but npm was not installed, so I installed npm



as above.
Apr.02,2021

say you don't have webpack, installed. Global installation

npm i webpack -g

this sentence means to install webpack, in the global node_modules. Generally speaking, we install some tool packages that are not related to the project, such as webpack,gulp, into the global node_modules, and put the npm package related to the project under the path of the project package.json

.
npm i

install these packages to node_modules in the project directory

Menu