Home > database >  Fail to install npm library - no directory created in node_modules
Fail to install npm library - no directory created in node_modules

Time:10-23

I am not able to successfully install node libraries. I can see the library with 'npm -g list' but there is no directory in node_modules and the same error about missing library comes up after I install the library.

I am not administrator on my machine but do not get any error messages about privileges.

See the following commands

> npm -g list
...
 -- minipass@2.6.0
|  -- safe-buffer@5.2.1
| `-- [email protected]
npm ERR! peer dep missing: @angular/[email protected], required by @angular/[email protected]
npm ERR! peer dep missing: @ngrx/[email protected], required by @ngrx/[email protected]
npm ERR! peer dep missing: @ngrx/[email protected], required by @ngrx/[email protected]
npm ERR! missing: minipass@^2.6.0, required by [email protected]
> npm -g install minipass@2.6.0
  minipass@2.6.0
updated 1 package in 0.405s
> npm -g list
...
 -- minipass@2.6.0
|  -- safe-buffer@5.2.1
| `-- [email protected]
npm ERR! peer dep missing: @angular/[email protected], required by @angular/[email protected]
npm ERR! peer dep missing: @ngrx/[email protected], required by @ngrx/[email protected]
npm ERR! peer dep missing: @ngrx/[email protected], required by @ngrx/[email protected]
npm ERR! missing: minipass@^2.6.0, required by [email protected]

I also do not see the minipass library installed:

>ls .\node_modules\ | Select-String "minipass"

fs-minipass
minipass-collect
minipass-fetch
minipass-flush
minipass-json-stream
minipass-pipeline
minipass-sized

I never ran 'npm init' as I got the source from github so think I don't need to do it.

Software versions are

Windows 10

npm is version 6.13.4

CodePudding user response:

npm install will create the directory and download dependencies, inside your project directory.

npm -g install will create the directory and download dependencies, but in a global folder, outside your project.

npm init will only create package.json.

  • Related