简体   繁体   English

安装了没有 npm init 的 npm 包

[英]Installed npm packages without npm init

I forgot to initialize npm by "npm init" and then installed other npm packages like express,ejs etc. inside my current project directory.我忘记通过“npm init”初始化 npm,然后在我当前的项目目录中安装了其他 npm 包,如 express、ejs 等。 Where are these packages stored since no package.json file is created?由于没有创建 package.json 文件,这些包存储在哪里? How do i find them?我如何找到它们? Do i need to uninstall them?我需要卸载它们吗?

Npm version 8.7.0 will automaticly create the package.json and package-lock.json files and the node_modules folder in the directory where you ran npm install from. Npm 8.7.0 版将自动在您运行npm install的目录中创建 package.json 和 package-lock.json 文件以及 node_modules 文件夹。

As per https://stackoverflow.com/a/57229830/18691323 , npm init only adds basic project infomation to the package.json file, or creates a certain type of program.根据https://stackoverflow.com/a/57229830/18691323npm init仅将基本项目信息添加到 package.json 文件,或创建某种类型的程序。

You can check your version of npm with npm -v .您可以使用npm -v检查您的 npm 版本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM