简体   繁体   中英

node_module folder not appear in working directory

I am a beginner with Node.js. I've created a directory and ran these commands with VS Code terminal:

npm init   
npm install

But the node_modules directory does not appear in the working directory.

Can anyone help me to solve this problem?

i assume that you use expressjs as middleware of nodejs

so try to hit this command on your terminal

npm init

this create a package.json for your project and then hit this command in you terminal

npm install express --save

express install in your working directory and --save entry in your package file

This is not a problem. As @JBallin suggested in his comment, the npm install command will only create the node_modules directory if there are some packages to be installed. Since you haven't add any dependencies to your project, there is nothing to place in the node_modules and NPM will not create it. It will be automatically created once you add any dependencies.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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