Angular JS | Bitbucket Pipelines fails | Step: NPM Install
Published: 2022-07-20 06:34:27

**Angular version 1.4
Issue 1:**
**Bitbucket pipeline failed at NPM Install.** here are the logs
`| | +-- mime-types@2.0.14 
| | | `-- mime-db@1.12.0 
| | +-- qs@3.1.0 
| | `-- tough-cookie@4.0.0 
| |   +-- psl@1.9.0 
| |   +-- punycode@2.1.1 
| |   `-- universalify@0.1.2 
| +-- saucelabs@1.0.1 
| | `-- https-proxy-agent@1.0.0 
| |   +-- agent-base@2.1.1 
| |   | `-- semver@5.0.3 
| |   `-- debug@2.6.9 
| |     `-- ms@2.0.0 
| +-- selenium-webdriver@2.47.0 
| | +-- ws@0.8.1 
| | | +-- bufferutil@1.2.1 
| | | | `-- bindings@1.2.1 
| | | +-- options@0.0.6 
| | | +-- ultron@1.0.2 
| | | `-- utf-8-validate@1.2.2 
| | |   `-- nan@2.4.0 
| | `-- xml2js@0.4.4 
| |   `-- sax@0.6.1 
| `-- source-map-support@0.2.10 
|   `-- source-map@0.1.32 
+-- require-dir@0.3.2 
+-- run-sequence@1.2.2 
+-- sinon@1.17.7 
| +-- formatio@1.1.1 
| +-- lolex@1.3.2 
| +-- samsam@1.1.2 
| `-- util@0.12.4 
|   +-- is-arguments@1.1.1 
|   | `-- has-tostringtag@1.0.0 
|   +-- is-generator-function@1.0.10 
|   +-- is-typed-array@1.1.9 
|   | +-- available-typed-arrays@1.0.5 
|   | +-- es-abstract@1.20.1 
|   | | +-- es-to-primitive@1.2.1 
|   | | | `-- is-symbol@1.0.4 
|   | | +-- function.prototype.name@1.1.5 
|   | | | `-- functions-have-names@1.2.3 
|   | | +-- get-symbol-description@1.0.0 
|   | | +-- internal-slot@1.0.3 
|   | | +-- is-callable@1.2.4 
|   | | +-- is-negative-zero@2.0.2 
|   | | +-- is-regex@1.1.4 
|   | | +-- is-shared-array-buffer@1.0.2 
|   | | +-- is-string@1.0.7 
|   | | +-- is-weakref@1.0.2 
|   | | +-- object-keys@1.1.1 
|   | | +-- regexp.prototype.flags@1.4.3 
|   | | +-- string.prototype.trimend@1.0.5 
|   | | +-- string.prototype.trimstart@1.0.5 
|   | | `-- unbox-primitive@1.0.2 
|   | |   `-- has-bigints@1.0.2 
|   | `-- for-each@0.3.3 
|   `-- which-typed-array@1.1.8 
+-- streamqueue@1.1.2 
| +-- isstream@0.1.2 
| `-- readable-stream@2.3.7 
|   +-- isarray@1.0.0 
|   `-- string_decoder@1.1.1 
+-- uglify-save-license@0.4.1 
+-- underscore.string@3.3.6 
| +-- sprintf-js@1.1.2 
| `-- util-deprecate@1.0.2 
+-- wiredep@2.2.2 
| +-- bower-config@0.5.3 
| | +-- graceful-fs@2.0.3 
| | +-- mout@0.9.1 
| | `-- osenv@0.0.3 
| +-- chalk@0.5.1 
| | +-- ansi-styles@1.1.0 
| | +-- has-ansi@0.1.0 
| | | `-- ansi-regex@0.2.1 
| | +-- strip-ansi@0.3.0 
| | `-- supports-color@0.2.0 
| +-- glob@4.5.3 
| | `-- minimatch@2.0.10 
| +-- lodash@2.4.2 
| +-- propprop@0.3.1 
| `-- through2@0.6.5 
|   `-- readable-stream@1.0.34 
`-- yargs@3.32.0 
  +-- camelcase@2.1.1 
  +-- cliui@3.2.0 
  | `-- wrap-ansi@2.1.0 
  +-- decamelize@1.2.0 
  +-- os-locale@1.4.0 
  | `-- lcid@1.0.0 
  |   `-- invert-kv@1.0.0 
  +-- string-width@1.0.2 
  | +-- code-point-at@1.1.0 
  | `-- is-fullwidth-code-point@1.0.0 
  +-- window-size@0.1.4 
  `-- y18n@3.2.2 
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.3.2 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules/karma/node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN ws@8.2.3 requires a peer of bufferutil@^4.0.1 but none was installed.
npm WARN ws@8.2.3 requires a peer of utf-8-validate@^5.0.2 but none was installed.
npm WARN dashboardApp@0.0.0 No repository field.
npm WARN dashboardApp@0.0.0 No license field.
npm ERR! Linux 5.13.0-1031-aws
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install"
npm ERR! node v6.11.4
npm ERR! npm  v3.10.10
npm ERR! path /opt/atlassian/pipelines/agent/build/node_modules/.staging/@types/node-43f1e04b/package.json
npm ERR! code ENOTDIR
npm ERR! errno -20
npm ERR! syscall open
npm ERR! ENOTDIR: not a directory, open '/opt/atlassian/pipelines/agent/build/node_modules/.staging/@types/node-43f1e04b/package.json'
npm ERR! 
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>
npm ERR! Please include the following file with any support request:
npm ERR!     /opt/atlassian/pipelines/agent/build/npm-debug.log`



**Issue 2:**

Angular JS Version: 1.4
Using node v6.11.4 (npm v3.10.10)
After installing all NPM dependencies for above angular js version, GULP is not running successfully. 
I have installed bower also but still keeps asking to install bower.
Below is error block:
```
sudo gulp    
[12:08:06] Using gulpfile ~/diy-frontend/gulpfile.js
[12:08:06] Starting 'clean'...
[12:08:06] Starting 'analyze'...
[12:08:06] Finished 'analyze' after 474 μs
[12:08:06] Finished 'clean' after 303 ms
[12:08:06] Starting 'markup'...
[12:08:06] Starting 'styles'...
[12:08:07] Starting 'bowerAssets'...
[12:08:07] Starting 'images'...
[12:08:08] Starting 'favicon'...
[12:08:08] Starting 'fonts'...
[12:08:08] Finished 'favicon' after 210 ms
[12:08:09] Finished 'fonts' after 1.53 s
[12:08:09] Finished 'bowerAssets' after 2.34 s
[12:08:10] Finished 'images' after 2.17 s
[12:08:10] Finished 'styles' after 3.15 s
[12:08:10] Finished 'markup' after 3.26 s
[12:08:10] Starting 'scripts'...
[12:08:10] Finished 'scripts' after 840 ms
[12:08:10] Starting 'inject'...
[12:08:11] gulp-inject 483 files into index.html.
[12:08:11] gulp-inject Nothing to inject into index.html.
[12:08:11] Finished 'inject' after 883 ms
[12:08:11] Starting 'bowerCopy'...
[12:08:11] Finished 'bowerCopy' after 103 ms
[12:08:11] Starting 'bowerInject'...
events.js:160
      throw er; // Unhandled 'error' event
      ^

Error: Error: intl-tel-input is not installed. Try running `bower install`.
    at /Users/tanveemoghe/diy-frontend/node_modules/wiredep/wiredep.js:30:56
    at /Users/tanveemoghe/diy-frontend/node_modules/wiredep/lib/detect-dependencies.js:145:29
    at forOwn (/Users/tanveemoghe/diy-frontend/node_modules/wiredep/node_modules/lodash/dist/lodash.js:2106:15)
    at Function.forEach (/Users/tanveemoghe/diy-frontend/node_modules/wiredep/node_modules/lodash/dist/lodash.js:3303:9)
    at detectDependencies (/Users/tanveemoghe/diy-frontend/node_modules/wiredep/lib/detect-dependencies.js:34:7)
    at wiredep (/Users/tanveemoghe/diy-frontend/node_modules/wiredep/wiredep.js:70:39)
    at DestroyableTransform._transform (/Users/tanveemoghe/diy-frontend/node_modules/wiredep/wiredep.js:135:34)
    at DestroyableTransform.Transform._read (/Users/tanveemoghe/diy-frontend/node_modules/wiredep/node_modules/readable-stream/lib/_stream_transform.js:184:10)
    at DestroyableTransform.Transform._write (/Users/tanveemoghe/diy-frontend/node_modules/wiredep/node_modules/readable-stream/lib/_stream_transform.js:172:12)
    at doWrite (/Users/tanveemoghe/diy-frontend/node_modules/wiredep/node_modules/readable-stream/lib/_stream_writable.js:237:10)
```

Which is suitable version of bower we should use though the bower is installed? this is my package.json ---
```
{
  "name": "dashboardApp",
  "version": "0.0.0",
  "scripts": {
    "test": "gulp test"
  },
  "dependencies": {
    "@shopify/app-bridge": "^2.0.5",
    "agora-rtc-sdk-ng": "^4.6.3",
    "connect-modrewrite": "^0.10.1"
  },

  "devDependencies": {
    "angular-mocks": "^1.6.9",
    "browser-sync": "^2.2.3",
    "del": "^2.0.0",
    "eslint-config-angular": "^0.2.0",
    "eslint-config-dustinspecker": "^0.1.0",
    "eslint-path-formatter": "^0.1.1",
    "eslint-plugin-angular": "^0.2.0",
    "find-up": "^1.0.0",
    "glob": "^5.0.1",
    "gulp": "^3.8.7",
    "gulp-add-src": "^0.2.0",
    "gulp-angular-filesort": "^1.0.4",
    "gulp-autoprefixer": "^2.0.0",
    "gulp-chmod": "^2.0.0",
    "gulp-concat": "^2.6.1",
    "gulp-connect": "^5.0.0",
    "gulp-css-rebase-urls": "0.0.5",
    "gulp-cssmin": "^0.1.6",
    "gulp-eslint": "^1.0.0",
    "gulp-filter": "^3.0.0",
    "gulp-htmlmin": "^1.0.0",
    "gulp-if": "^1.2.4",
    "gulp-imagemin": "^2.0.0",
    "gulp-inject": "^1.5.0",
    "gulp-jscs": "^3.0.0",
    "gulp-jshint": "^1.8.4",
    "gulp-load-plugins": "^0.10.0",
    "gulp-modify-css-urls": "^0.2.0",
    "gulp-ng-annotate": "^1.1.0",
    "gulp-ng-html2js": "^0.2.0",
    "gulp-notify": "^2.1.0",
    "gulp-order": "^1.1.1",
    "gulp-plumber": "^1.0.0",
    "gulp-protractor": "^1.0.0",
    "gulp-rename": "^1.2.0",
    "gulp-rev": "^5.1.0",
    "gulp-sass": "^2.0.4",
    "gulp-sourcemaps": "^1.5.1",
    "gulp-string-replace": "^0.4.0",
    "gulp-tslint": "^3.1.2",
    "gulp-uglify": "^1.5.4",
    "gulp-util": "^3.0.8",
    "jasmine-core": "^3.1.0",
    "jshint-stylish": "^2.0.1",
    "karma": "^0.13.3",
    "karma-chrome-launcher": "^2.2.0",
    "karma-coverage": "^0.4.2",
    "karma-failed-reporter": "^0.0.3",
    "karma-jasmine": "^0.3.8",
    "karma-ng-html2js-preprocessor": "^0.1.0",
    "karma-phantomjs-launcher": "^0.2.3",
    "karma-sinon": "^1.0.3",
    "lodash": "^3.6.0",
    "main-bower-files": "^2.0.0",
    "multi-glob": "^0.4.0",
    "phantomjs": "^1.9.18",
    "plato": "^1.4.0",
    "protractor": "^2.0.0",
    "require-dir": "^0.3.0",
    "run-sequence": "^1.0.2",
    "sinon": "^1.17.2",
    "streamqueue": "^1.1.0",
    "uglify-save-license": "^0.4.1",
    "underscore.string": "^3.0.1",
    "wiredep": "^2.2.0",
    "yargs": "^3.4.5"
  }
}

```