node_modules Is not showing In VsCode file explorer - javascript

node_modules is not showing in file explorer of VsCode, even if I install any module it is not updating in package.json. But module is installing.
I tried following:
npm init
npm install jest --save-dev
It is showing the packages are installed but it was not generating node_modules and updating package.json

Related

if i deleted my project but i have that in my github so did i have to re install all the dependencies again or just run npm install?

My question is if i deleted my project but i have that in my github so did i have to re install all the dependencies again or just run npm install? i formeted my pc so i project lost away but before formet i uploaded my project on github so do i have to download all dependencies again or just run npm install? i have dependencies of nodejs react native and choco socketio and some more so that i can do downlaod everthing again or just npm install and all dependencies will be install by npm
once you run git clone [REPO_URL] if all dependencies are listed in package.json then running npm install in cloned project directory will install all dependencies

How to install node dependencies for custom package

i'm making a custom package for a project that i'm making, but it requires typescript to be installed as a local dependency...
npm i typescript #types/node ts-node ts-node-dev
This installs it in a node_modules folder, as per usual. The problem is though is when i try to locally install the package...
npm i ../package
it automatically creates a node_modules folder, and then installs it there. The package is installed inside a node_modules folder, within a package folder, within another node_modules folder.
My question is: how do i install it in the parent node_modules folder as a dependency alongside the custom one?

An unhandled exception occurred: Could not find module "#angular-devkit/build-angular"

When running the terminal commands ng server or ng serve I'm getting this issue:
An unhandled exception occurred: Could not find module "#angular-devkit/build-angular"
Check in your package.json to see if you have this package in your devDependencies section or not
"devDependencies": {
"#angular-devkit/build-angular": "~0.803.18"
}
If exist try to
delete package-lock.json or yarn-lock.json
run
npm cache clean --force
then run
npm i
Install #angular-devkit/build-angular as dev dependency.
npm install --save-dev #angular-devkit/build-angular
or,
yarn add #angular-devkit/build-angular --dev
This error (Unhandled exception for a module) occurs when node_modules folder does not exist inside the project, or when the folder exists, but does not contain all the dependencies downloaded.
$ npm install command will download all the dependencies into the node_modules folder of the proejct.
npm install is automatically triggered in the background by the 'ng new', at the time of creation of the angular project.
The other angular commands like 'ng build' or 'ng serve' commands assume that 'ng new' had completed successfully.
If, for some reason, the npm install failed at the time of creation, or if the node_modules folder got deleted after the project was created, then the other angular commands (ng serve, ng build, ...) will generate this 'Unhandled Exception'.
Manually executing the npm install command inside the project will download the dependencies and fix the issue.
try this
npm install --save-dev #angular-devkit/build-angular
Make sure "#angular-devkit/build-angular": "~0.10.0" is available in devDependencies of package.json before running npm install in your angular root directory.

"npm install" is not downloading all files from the "babel-core" package, but it does if I specifically install "babel-core". Why?

This is my package.json.
If I do an npm install from the root folder, it installs all the packages. However, the ./node_modules/babel-core/ folder will only have these files:
browser.min.js
browser-polyfill.js
package.json
Some files are missing, like the register.js file.
However, if I manually install babel-core, like this: npm install babel-core, the ./node_modules/babel-core/ folder will be complete. The register.js file will not be missing.
What I don't understand is: How can some files be missing if I install all the packages but not be missing if I install a specific package?
OBS: I'm having this problem running on a Ubuntu VM. Node version: 0.12.X. This problem seems not to occur when I'm on Windows.

NPM shrinkwrap in development

What happens when you do npm install in a dev environment on a project that has both a package.json and a npm-shrinkwrap.json file?
Will it ignore the shrinkwrap and use package.json for everything or just for the dev dependencies?
Any files added to the production dependencies in package.json will be ignored if they are not in the npm-shrinkwrap.json. Vis-à-vis: running npm install with foo-package added to the production dependency list will not install foo-package.
Not so for devDependancies.
Running npm install with foo-package added to the devDependency list will install foo-package even if it is not found in the npm-shrinkwrap.json file.
Fun.
Node: v4.2.4
NPM: 2.14.12

Categories

Resources