npm install module in current directory

后端 未结 7 1299
眼角桃花
眼角桃花 2020-12-12 21:00

When I run:

npm install my-app

The app is installed into node_modules/my-app/...

I also tried

npm install -g my-app         


        
7条回答
  •  没有蜡笔的小新
    2020-12-12 21:38

    As @dalu said, if you want to have local packages, you'll need a package.json file.

    But to create the package.json file, you will have to initialize npm by running npm init.

    You can then use npm install --save[-dev].

提交回复
热议问题