0

Trying to remove the 'libnpmhook' sub module when npm node_module is installed. Can this be removed from project.json somehow? Or am I adding npm incorrectly in my project.json file? I'm thinking that the npm node_module can be installed globally and does not need to be included in the project.json file for local install somehow.

Reasons I want to remove this from my local npm node_moduels are below along with project.json file.

In visual Studio when I run this command in the root of a ng6 npm node project it has issues (it finds two instances where files are over 260 chars):

dir /s /b > out.txt 

How do I find files with a path length greater than 260 characters in Windows?

The directory name C:\src\MyNG6\node_modules\npm\node_modules\libnpmhook\node_modules\npm-registry-fetch\node_modules\make-fetch-happen\node_module
s\https-proxy-agent\node_modules\agent-base\node_modules\es6-promisify\node_modules\es6-promise\lib\es6-promise\promise is too long.
The directory name C:\src\MyNG6\node_modules\npm\node_modules\libnpmhook\node_modules\npm-registry-fetch\node_modules\make-fetch-happen\node_module
s\socks-proxy-agent\node_modules\agent-base\node_modules\es6-promisify\node_modules\es6-promise\lib\es6-promise\promise is too long.

Note: I followed this advice as well and it did not fix the 260 char limit problem. Still got an error when pulling master branch.

https://developercommunity.visualstudio.com/content/problem/26285/vs2017-git-checkout-branch-the-specified-path-file.html

Apparently this libnpmhook full path is so large it doesn't allow git to work inside of visual studio 2107. At least on my computer.

When I remove this sub node-modules library inside of the npm node_module everything works great. I deleted the 'libnpmhook' directory in my local node_modules/npm/node_modules/libnpmhook.

I attempted to install "npm install -g" for my ng6 package. But when I attempted to run "ng serve" I was expecting the modules to be available locally.

Is it possible to have "ng serve" work with no local npm packages and all of them installed globally?

This is what package.json looks like:

{
  "name": "myng-ui",
  "version": "0.0.0",
  "scripts": {
    "ng": "ng",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e",
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "^6.0.3",
    "@angular/common": "^6.0.3",
    "@angular/compiler": "^6.0.3",
    "@angular/core": "^6.0.3",
    "@angular/forms": "^6.0.3",
    "@angular/http": "^6.0.3",
    "@angular/platform-browser": "^6.0.3",
    "@angular/platform-browser-dynamic": "^6.0.3",
    "@angular/router": "^6.0.3",
    "@auth0/angular-jwt": "^2.0.0",
    "bootstrap": "^4.1.1",
    "core-js": "^2.5.4",
    "font-awesome": "^4.7.0",
    "moment": "^2.22.2",
    "ng-sidebar": "^7.2.0",
    "ngx-bootstrap": "^3.0.0",
    "ngx-moment": "^3.0.1",
    "npm": "^6.1.0",
    "rxjs": "^6.0.0",
    "zone.js": "^0.8.26"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "~0.6.6",
    "@angular/cli": "^6.0.8",
    "@angular/compiler-cli": "^6.0.3",
    "@angular/language-service": "^6.0.3",
    "@types/jasmine": "~2.8.6",
    "@types/jasminewd2": "~2.0.3",
    "@types/node": "~8.9.4",
    "codelyzer": "~4.2.1",
    "jasmine-core": "~2.99.1",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "^2.0.3",
    "karma-chrome-launcher": "~2.2.0",
    "karma-coverage-istanbul-reporter": "~2.0.0",
    "karma-jasmine": "~1.1.1",
    "karma-jasmine-html-reporter": "^0.2.2",
    "protractor": "~5.3.0",
    "ts-node": "~5.0.1",
    "tslint": "~5.9.1",
    "typescript": "~2.7.2"
  }
}
RetroCoder
  • 2,597
  • 10
  • 52
  • 81

1 Answers1

0

Without changing anything else just do this:

npm uninstall npm

Then:

npm install -g npm

Someone, most like likely accidentally, performed a:

npm install npm --save   

or (reference)

npm install npm --save-dev

Visual Studio ide and dist deployment will most likely notice a marked improvement and reduce size of project and minified code.

RetroCoder
  • 2,597
  • 10
  • 52
  • 81