NPM : checkPermissions Missing write access to /.../node_modules/is - node.js

I am getting following error every time I run a npm install on my project:
npm WARN checkPermissions Missing write access to /../node_modules/is
npm ERR! path /.../node_modules/is
npm ERR! code ELOOP
npm ERR! errno -62
npm ERR! syscall access
npm ERR! ELOOP: too many symbolic links encountered, access '/.../node_modules/is'
npm ERR! A complete log of this run can be found in:
npm ERR! /.../.npm/_logs/2017-07-14T15_19_32_340Z-debug.log
Issue gets resolved after I delete a shortcut file called "is" in my node_modules folder. But it gets re-generated again after one successful npm install run.
Following is my package.json:
{
"name": "SDKIonic",
"version": "0.0.1",
"author": "Ionic Framework",
"homepage": "http://ionicframework.com/",
"private": true,
"scripts": {
"clean": "ionic-app-scripts clean",
"build": "ionic-app-scripts build",
"lint": "ionic-app-scripts lint",
"ionic:build": "ionic-app-scripts build",
"ionic:serve": "ionic-app-scripts serve"
},
"dependencies": {
"#angular/common": "4.1.3",
"#angular/compiler": "4.1.3",
"#angular/compiler-cli": "4.1.3",
"#angular/core": "^4.1.3",
"#angular/forms": "4.1.3",
"#angular/http": "4.1.3",
"#angular/platform-browser": "4.1.3",
"#angular/platform-browser-dynamic": "4.1.3",
"#ionic-native/core": "3.10.2",
"#ionic-native/splash-screen": "3.10.2",
"#ionic-native/status-bar": "3.10.2",
"#ionic/storage": "2.0.1",
"airwatch-sdk-plugin": "^1.0.7",
"cordova-android": "^6.2.3",
"cordova-ios": "^4.4.0",
"cordova-plugin-console": "^1.0.5",
"cordova-plugin-device": "^1.1.4",
"cordova-plugin-splashscreen": "^4.0.3",
"cordova-plugin-statusbar": "^2.2.2",
"cordova-plugin-whitelist": "^1.3.1",
"ionic-angular": "3.4.2",
"ionic-plugin-keyboard": "^2.2.1",
"ionicons": "3.0.0",
"is": "file:node_modules/is",
"rxjs": "5.4.0",
"sw-toolbox": "3.6.0",
"zone.js": "0.8.12"
},
"devDependencies": {
"#ionic/app-scripts": "1.3.7",
"#ionic/cli-plugin-cordova": "1.4.1",
"#ionic/cli-plugin-ionic-angular": "1.3.1",
"typescript": "2.3.3"
},
"description": "An Ionic project",
"cordova": {
"plugins": {
"cordova-plugin-console": {},
"cordova-plugin-device": {},
"cordova-plugin-splashscreen": {},
"cordova-plugin-statusbar": {},
"cordova-plugin-whitelist": {},
"ionic-plugin-keyboard": {},
"com.airwatch.awsdkplugin": {}
},
"platforms": [
"android",
"ios"
]
}
}
I tried changing permission to read-write for everyone but no luck.

If you are in a mac or any unix based system try to run
the command again as root/Administrator.
sudo npm install

This is a recursive dependency (the is dependency points to node_modules/is, which is also where the is dependency itself will get installed):
"is": "file:node_modules/is"
If you mean to install the is package (this one), remove that line from your package.json and install it properly:
npm i is --save

Related

npm i command works in one terminal directory and not working in a different directory for a same nestJs Project in a ubuntumachine?

I have cloned a nestJs project which has the package.json file as below :
###package.json :
{
"name": "customer-portal-api-server",
"version": "0.0.1",
"description": "",
"author": "",
"private": true,
"license": "UNLICENSED",
"scripts": {
"prebuild": "rimraf dist",
"build": "nest build",
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
"start": "nest start",
"start:dev": "nest start --watch",
"start:debug": "nest start --debug --watch",
"start:prod": "node dist/main",
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
"test": "jest",
"test:watch": "jest --watch",
"test:cov": "jest --coverage",
"prepare": "husky install",
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
"test:e2e": "jest --config ./test/jest-e2e.json",
"migrate:dev": "dotenv -e .development.env -- npx prisma migrate dev",
"seed-run:dev": "dotenv -e .development.env -- npx prisma db seed",
"prisma-studio:dev": "dotenv -e .development.env -- npx prisma studio"
},
"dependencies": {
"#fastify/static": "^6.8.0",
"#nestjs/common": "^9.0.0",
"#nestjs/config": "^2.2.0",
"#nestjs/core": "^9.0.0",
"#nestjs/jwt": "^9.0.0",
"#nestjs/passport": "^9.0.0",
"#nestjs/platform-express": "^9.0.0",
"#nestjs/platform-fastify": "^9.1.4",
"#nestjs/swagger": "^6.2.1",
"#prisma/client": "^4.10.1",
"bcrypt": "^5.1.0",
"class-transformer": "^0.5.1",
"class-validator": "^0.14.0",
"fastify": "^4.12.0",
"joi": "^17.7.0",
"moment": "^2.29.4",
"passport": "^0.6.0",
"passport-jwt": "^4.0.1",
"reflect-metadata": "^0.1.13",
"rimraf": "^3.0.2",
"rxjs": "^7.2.0"
},
"devDependencies": {
"#nestjs/cli": "^9.0.0",
"#nestjs/schematics": "^9.0.0",
"#nestjs/testing": "^9.0.0",
"#types/express": "^4.17.13",
"#types/jest": "27.5.0",
"#types/node": "^16.0.0",
"#types/supertest": "^2.0.11",
"#typescript-eslint/eslint-plugin": "^5.0.0",
"#typescript-eslint/parser": "^5.0.0",
"eslint": "^8.0.1",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-prettier": "^4.0.0",
"husky": "^8.0.3",
"jest": "28.0.3",
"prettier": "^2.3.2",
"prisma": "^4.10.0",
"source-map-support": "^0.5.20",
"supertest": "^6.1.3",
"ts-jest": "28.0.1",
"ts-loader": "^9.2.3",
"ts-node": "^10.0.0",
"tsconfig-paths": "4.0.0",
"typescript": "^4.3.5"
},
"jest": {
"moduleFileExtensions": [
"js",
"json",
"ts"
],
"rootDir": "src",
"testRegex": ".*\\.spec\\.ts$",
"transform": {
"^.+\\.(t|j)s$": "ts-jest"
},
"collectCoverageFrom": [
"**/*.(t|j)s"
],
"coverageDirectory": "../coverage",
"testEnvironment": "node"
},
"prisma": {
"seed": "ts-node prisma/seeders/seed_data.ts"
}
}
When i try to install node_modules using the npm i command .
Initially It showed the husky not available error . So I installed the husky using the below command :
export PATH="./node_modules/.bin:$PATH"
After the command **husky got installed ** . But bcrypt package shows the below error :
kathishkumaran#kathish-Latitude-3420:~/Documents/projects$ npm i
npm ERR! code 1
npm ERR! path /home/kathishkumaran/Documents/project/node_modules/bcrypt
npm ERR! command failed
npm ERR! command sh -c node-pre-gyp install --fallback-to-build
npm ERR! Failed to execute '/usr/bin/node /
npm ERR! A complete log of this run can be found in:
npm ERR! /home/kathishkumaran/.npm/_logs/2023-02-15T17_35_42_847Z-debug-0.log
.
.
.
So I try to copy the project and pasted in another directory and did the same as i mentioned above.
But bcrypt package is get installed sucessfully and run as expected as below :
kathishkumaran#kathish-Latitude-3420:~/Desktop/server-api$ npm i
> xxx#0.0.1 prepare
> husky install
husky - Git hooks installed
removed 888 packages, changed 1 package, and audited 871 packages in 4s
97 packages are looking for funding
run `npm fund` for details
2 moderate severity vulnerabilities
To address all issues (including breaking changes), run:
npm audit fix --force
Run `npm audit` for details.
NOTE:
In Both directories the versions are same as below :
xxx$ node -v
v18.14.0
xxx$ npm -v
9.3.1
xxx$ nvm -v
0.39.1
xxx$
So someone help me to fix this issue in my linux system.

Electron-builder Error: Application directory dist doesn't exists

The app built a couple of years ago using:
Angular v5.2.0
Angular-CLI v1.6.4
Electron v1.7.8
Electron Builder v20.0.5
Node 10.15.0
NPM 6.4.1
node-gyp 3.8.0
It was last compiled in September 2019 but now when run npm i after cloning from the repo getting the following error on electron-builder. Running on Windows 10 and Visual Studio Code. I've got the same error on MacOS Catalina.
PS C:\[Project\directory]> npm i
npm WARN deprecated fsevents#1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade t
> [projectname-version]-beta postinstall C:\Pinro\8track-player
> electron-builder install-app-deps
• electron-builder version=20.0.5
• loaded configuration file=C:[project\directory]\electron-builder.json
Error: Application directory dist doesn't exists
at C:\[project\directory]\node_modules\electron-builder-lib\src\util\config.ts:140:13
From previous event:
at computeDefaultAppDirectory (C:\[project\directory]\node_modules\electron-builder-lib\out\util\config.js:131:22)
at C:\[project\directory]\node_modules\electron-builder\src\cli\install-app-deps.ts:52:78
at Generator.next (<anonymous>)
From previous event:
at installAppDeps (C:\[project\directory]\node_modules\electron-builder\out\cli\install-app-deps.js:51:21)
at then (C:\[project\directory]\node_modules\electron-builder\src\cli\cli.ts:48:33)
at runCallback (timers.js:705:18)
at tryOnImmediate (timers.js:676:5)
at processImmediate (timers.js:658:5)
From previous event:
at Object.args [as handler] (C:\[project\directory]\node_modules\electron-builder\src\cli\cli.ts:48:33)
at Object.runCommand (C:\[project\directory]\node_modules\electron-builder\node_modules\yargs\lib\command.js:235:44
at Object.parseArgs [as _parseArgs] (C:\[project\directory]\node_modules\electron-builder\node_modules\yargs\yargs.
at Object.get [as argv] (C:\[project\directory]\node_modules\electron-builder\node_modules\yargs\yargs.js:965:21)
at Object.<anonymous> (C:\[project\directory]node_modules\electron-builder\src\cli\cli.ts:42:15)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:742:12)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:743:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [project-name-version]-beta postinstall: `electron-builder install-app-deps`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [project-name-version]-beta postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\[Project directory]\AppData\Roaming\npm-cache\_logs\2020-07-12T07_25_33_106Z-debug.log
PS C:\[Project\directory]>
package.json:
{
"name": "[project-name]",
"version": "[version-number]-beta",
"description": "",
"author": {
"name": "",
"email": ""
},
"keywords": [
"angular",
"angular 5",
"electron",
"typescript",
"sass"
],
"main": "main.js",
"private": true,
"scripts": {
"ng": "ng",
"lint": "ng lint",
"start": "tsc main.ts && npm-run-all --parallel webpack:watch electron:serve",
"webpack:watch": "webpack --watch",
"start:web": "webpack-dev-server --content-base . --port 4200 --inline",
"build:electron:main": "tsc main.ts --outDir dist && copyfiles package.json dist && cd dist && npm install --prod && cd ..",
"build": "webpack --display-error-details && npm run build:electron:main",
"build:prod": "cross-env NODE_ENV=production npm run build",
"electron:serve": "npm run build:electron:main && electron ./dist --serve",
"electron:test": "electron ./dist",
"electron:dev": "npm run build && electron ./dist",
"electron:prod": "npm run build:prod && electron ./dist",
"electron:linux": "npm run build:prod && npx electron-builder build --linux",
"electron:windows": "npm run build:prod && npx electron-builder build --windows",
"electron:mac": "npm run build:prod && npx electron-builder build --mac",
"rebuild": "electron-rebuild -f -w sqlite3 -v 1.8",
"test": "karma start ./karma.conf.js",
"pree2e": "webdriver-manager update --standalone false --gecko false --quiet && npm run build",
"e2e": "protractor ./protractor.conf.js",
"postinstall": "electron-builder install-app-deps"
},
"dependencies": {
"#types/bluebird": "3.5.20",
"electron-builder-squirrel-windows": "20.0.5",
"electron-rebuild": "^1.11.0",
"electron-squirrel-startup": "^1.0.0",
"sqlite3": "https://github.com/mapbox/node-sqlite3/tarball/master"
},
"devDependencies": {
"#angular-devkit/core": "^0.3.1",
"#angular/cli": "1.6.4",
"#angular/common": "5.2.0",
"#angular/compiler": "5.2.0",
"#angular/compiler-cli": "5.2.0",
"#angular/core": "5.2.0",
"#angular/forms": "5.2.0",
"#angular/http": "5.2.0",
"#angular/language-service": "5.2.0",
"#angular/platform-browser": "5.2.0",
"#angular/platform-browser-dynamic": "5.2.0",
"#angular/router": "5.2.0",
"#ng-bootstrap/ng-bootstrap": "1.1.1",
"#ngx-translate/core": "9.0.1",
"#ngx-translate/http-loader": "2.0.0",
"#types/core-js": "0.9.46",
"#types/jasmine": "2.5.54",
"#types/jasminewd2": "2.0.2",
"#types/lodash": "^4.14.50",
"#types/node": "^7.10.2",
"amplitudejs": "^3.2.3",
"autoprefixer": "7.1.4",
"bootstrap": "^4.0.0",
"chart.js": "^2.5.0",
"circular-dependency-plugin": "3.0.0",
"codelyzer": "3.2.0",
"copy-webpack-plugin": "4.1.1",
"copyfiles": "1.2.0",
"core-js": "2.4.1",
"cross-env": "5.0.5",
"crypto-js": "^3.1.9-1",
"css-loader": "0.28.7",
"cssnano": "3.10.0",
"diskspace": "^2.0.0",
"electron": "^1.8.8",
"electron-builder": "20.0.5",
"electron-builder-squirrel-windows": "20.0.5",
"electron-json-storage": "^4.0.2",
"electron-log": "^2.2.14",
"electron-reload": "1.2.2",
"electron-squirrel-startup": "^1.0.0",
"enhanced-resolve": "3.3.0",
"exports-loader": "0.6.4",
"file-loader": "1.1.5",
"html-loader": "0.5.1",
"html-webpack-plugin": "2.29.0",
"is-online": "^7.0.0",
"istanbul-instrumenter-loader": "3.0.0",
"jasmine-core": "2.8.0",
"jasmine-spec-reporter": "4.2.1",
"jquery": "^3.3.1",
"json-loader": "0.5.7",
"karma": "1.7.1",
"karma-chrome-launcher": "2.2.0",
"karma-cli": "1.0.1",
"karma-coverage-istanbul-reporter": "1.3.0",
"karma-jasmine": "1.1.0",
"karma-jasmine-html-reporter": "0.2.2",
"karma-sourcemap-loader": "0.3.7",
"less-loader": "4.0.5",
"minimist": "1.2.0",
"mkdirp": "0.5.1",
"node-cron": "^1.2.1",
"node-vibrant": "^3.0.0",
"npm-run-all": "^4.1.2",
"npx": "^9.7.1",
"os-name": "^2.0.1",
"popper.js": "^1.14.3",
"postcss-custom-properties": "6.2.0",
"postcss-loader": "2.0.6",
"postcss-url": "7.1.2",
"protractor": "5.1.2",
"raw-loader": "0.5.1",
"replace": "^0.3.0",
"rimraf": "^2.6.2",
"rxjs": "5.5.2",
"sass-loader": "6.0.6",
"script-loader": "0.7.1",
"source-map-loader": "0.2.1",
"style-loader": "0.18.2",
"stylus-loader": "3.0.1",
"ts-node": "3.3.0",
"tslint": "5.7.0",
"typescript": "2.6.2",
"uglifyjs-webpack-plugin": "1.0.0",
"url-loader": "0.6.2",
"wait-on": "^2.1.0",
"webdriver-manager": "12.0.6",
"webpack": "3.8.1",
"webpack-concat-plugin": "1.4.0",
"webpack-dev-server": "2.9.3",
"zone.js": "0.8.17"
},
"files": [
"*.js",
"build",
"node_modules"
],
"engines": {
"node": "10.15.0"
}
}
electron-builder.json:
{
"productName": "[Project name]",
"appId": "[ID]",
"directories": {
"app": "dist",
"output": "app-builds"
},
"win": {
"icon": "dist/favicon",
"target": [
"squirrel"
]
},
"mac": {
"icon": "dist/favicon",
"target": [
"dmg"
]
},
"linux": {
"icon": "dist",
"target": [
"AppImage"
]
}
}
What I have done so far:
Windows 10:
Installed Node 10.15.0 and NPM 6.4.1
node-gyp 3.8.0
windows-build-tools
Can you please suggest any solution to run the app? Thanks in advance.
Error debug log - screencapture

Carousel.d.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or'include' property

During the universal building an Angular application to run on server side I am facing the following error's.
ERROR in ./src/app/shared/components/carousel/interface/Carousel.d.ts
Module build failed: Error: /home/training/Desktop/vishnu/TemplateAppv6/src/app/shared/components/carousel/interface/Carousel.d.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or'include' property.
at AngularCompilerPlugin.getCompiledFile (/home/training/Desktop/vishnu/TemplateAppv6/node_modules/#ngtools/webpack/src/angular_compiler_plugin.js:749:23)
at plugin.done.then (/home/training/Desktop/vishnu/TemplateAppv6/node_modules/#ngtools/webpack/src/loader.js:41:31)
at process._tickCallback (internal/process/next_tick.js:68:7)
ERROR in ./src/app/shared/components/grid/interface/Grid.d.ts
Module build failed: Error: /home/training/Desktop/vishnu/TemplateAppv6/src/app/shared/components/grid/interface/Grid.d.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property.
at AngularCompilerPlugin.getCompiledFile (/home/training/Desktop/vishnu/TemplateAppv6/node_modules/#ngtools/webpack/src/angular_compiler_plugin.js:749:23)
at plugin.done.then (/home/training/Desktop/vishnu/TemplateAppv6/node_modules/#ngtools/webpack/src/loader.js:41:31)
at process._tickCallback (internal/process/next_tick.js:68:7)
ERROR in ./src/app/shared/components/footer/footer.component.ts
Module not found: Error: Can't resolve '../../../configuration/interfaces/GlobalConfig' in '/home/training/Desktop/vishnu/TemplateAppv6/src/app/shared/components/footer'
ERROR in ./src/app/home/home.component.ts
Module not found: Error: Can't resolve './interfaces/home' in '/home/training/Desktop/vishnu/TemplateAppv6/src/app/home'
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! template-appv6#0.0.0 build:client-and-server-bundles: ng build --prod --build-optimizer
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the template-appv6#0.0.0 build:client-and-server-bundles script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/training/.npm/_logs/2018-10-04T05_22_21_129Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! template-appv6#0.0.0 build:ssr: npm run build:client-and-server-bundles && npm run webpack:server
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the template-appv6#0.0.0 build:ssr script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/training/.npm/_logs/2018-10-04T05_22_21_183Z-debug.log
The issue is with the tsconfig file, i presume so here is mine.
{
"compileOnSave": false,
"compilerOptions": {
"baseUrl": "./",
"outDir": "./dist/out-tsc",
"sourceMap": true,
"module": "es2015",
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"target": "es5",
"declaration": true,
"declarationDir": "definitions"
"lib": [
"es2017",
"dom"
]
}
}
I tried to insert the following lines after seeing it in few github places
"#abp/": [ "../node_modules/abp-ng2-module/dist/src/" ]
But issue still persists.
My package.json file
{
"name": "template-appv6",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e",
"build:ssr": "npm run build:client-and-server-bundles && npm run webpack:server",
"serve:ssr": "node dist/server",
"build:client-and-server-bundles": "ng build --prod --build-optimizer",
"webpack:server": "webpack --config webpack.server.config.js --progress --colors"
},
"typings": "definitions/index",
"typescript": {
"definition": "definitions/index"
},
"private": true,
"dependencies": {
"#angular/animations": "^6.1.0",
"#angular/cdk": "^6.4.7",
"#angular/common": "^6.1.0",
"#angular/compiler": "^6.1.0",
"#angular/core": "^6.1.0",
"#angular/flex-layout": "^6.0.0-beta.18",
"#angular/forms": "^6.1.0",
"#angular/http": "^6.1.0",
"#angular/material": "^6.4.7",
"#angular/platform-browser": "^6.1.0",
"#angular/platform-browser-dynamic": "^6.1.0",
"#angular/platform-server": "^6.1.9",
"#angular/router": "^6.1.0",
"#nguniversal/express-engine": "^6.1.0",
"#nguniversal/module-map-ngfactory-loader": "^6.1.0",
"bootstrap": "^4.1.3",
"core-js": "^2.5.4",
"entitlement": "^0.1.1",
"font-awesome": "^4.7.0",
"jquery": "^3.3.1",
"ng-recaptcha": "^3.0.5",
"ng2-dropdown": "0.0.21",
"ngx": "^2.4.0",
"ngx-facebook": "^2.4.0",
"ngx-infinite-scroll": "^6.0.1",
"ngx-owl-carousel": "^2.0.7",
"ngx-popover": "0.0.16",
"ngx-webstorage": "^2.0.1",
"ngx-webstorage-service": "^3.1.1",
"reinstall": "^2.0.0",
"rxjs": "^6.0.0",
"script-loader": "^0.7.2",
"ts-loader": "^5.2.1",
"video.js": "^7.2.3",
"videojs": "^1.0.0",
"zone.js": "~0.8.26"
},
"devDependencies": {
"#angular-devkit/build-angular": "~0.7.0",
"#angular/cli": "~6.1.2",
"#angular/compiler-cli": "^6.1.0",
"#angular/language-service": "^6.1.0",
"#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": "^3.0.0",
"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.4.1",
"ts-node": "~5.0.1",
"tslint": "~5.9.1",
"typescript": "~2.9.2"
}
}
Any help would be greatly appreciated.
Remove the following property from tsconfig.json:
"typeRoots": [
"node_modules/#types"
],
As being explained on typescriptlang
By default all visible “#types” packages are included in your compilation. Packages in node_modules/#types of any enclosing folder are considered visible; specifically, that means packages within ./node_modules/#types/, ../node_modules/#types/, ../../node_modules/#types/, and so on.
If typeRoots is specified, only packages under typeRoots will be included
UPDATE:
Another approach would be to emit your declaration files in a separate folder:
In your tsconfig.json add:
"declaration": true,
"declarationDir": "definitions"
And in your package.json add the following properties with path to definitions:
"typings": "definitions/index",
"typescript": {
"definition": "definitions/index"
},

npm i is not working after upgrading to the latest node and npm

I have upgraded node and npm. Now ionic 3 (3.9.2) project (this works fine before the upgrade to node and npm) is not working for npm i. But it is working fine for new projects. Could you tell me how to sort out this issue?
node: 8.11.2
npm: 5.6.0
This is the error when I tried with npm i
npm WARN deprecated highcharts-more#0.1.2: this package has been deprecated, just import modules from the highcharts folder
npm ERR! code ENOLOCAL
npm ERR! Could not install from "node_modules\cordova-plugin-badge" as it does not contain a package.json file.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\lokuge\AppData\Roaming\npm-cache\_logs\2018-06-14T07_15_19_651Z-debug.log
Additional info: Since this is an old project this doesn't have package-lock.json. It has only the package.json
package.json
{
"name": "Test",
"version": "0.0.1",
"author": "Ionic Framework",
"homepage": "http://ionicframework.com/",
"private": true,
"scripts": {
"clean": "ionic-app-scripts clean",
"build": "ionic-app-scripts build",
"lint": "ionic-app-scripts lint",
"ionic:build": "ionic-app-scripts build",
"ionic:serve": "ionic-app-scripts serve"
},
"dependencies": {
"#angular/common": "5.0.0",
"#angular/compiler": "5.0.0",
"#angular/compiler-cli": "5.0.0",
"#angular/core": "5.0.0",
"#angular/forms": "5.0.0",
"#angular/http": "5.0.0",
"#angular/platform-browser": "5.0.0",
"#angular/platform-browser-dynamic": "5.0.0",
"#ionic-native/app-rate": "4.5.3",
"#ionic-native/call-number": "4.3.3",
"#ionic-native/camera": "4.3.2",
"#ionic-native/contacts": "4.3.3",
"#ionic-native/core": "4.3.3",
"#ionic-native/facebook": "4.5.3",
"#ionic-native/file": "4.5.3",
"#ionic-native/file-opener": "4.5.3",
"#ionic-native/firebase": "4.5.3",
"#ionic-native/globalization": "4.5.3",
"#ionic-native/google-plus": "4.5.3",
"#ionic-native/in-app-browser": "^4.6.0",
"#ionic-native/local-notifications": "4.5.3",
"#ionic-native/network": "4.5.3",
"#ionic-native/screen-orientation": "4.4.2",
"#ionic-native/social-sharing": "4.3.3",
"#ionic-native/splash-screen": "4.3.2",
"#ionic-native/status-bar": "4.3.2",
"#ionic/storage": "2.1.3",
"#types/papaparse": "4.1.33",
"angular2-text-mask": "8.0.2",
"angularfire2": "5.0.0-rc.6",
"call-number": "^1.0.1",
"cordova-android": "^6.3.0",
"cordova-ios": "4.5.4",
"cordova-plugin-apprate": "1.3.0",
"cordova-plugin-badge": "file:node_modules\\cordova-plugin-badge",
"cordova-plugin-camera": "2.4.1",
"cordova-plugin-compat": "1.2.0",
"cordova-plugin-contacts": "2.3.1",
"cordova-plugin-device": "1.1.7",
"cordova-plugin-dialogs": "2.0.1",
"cordova-plugin-facebook4": "1.9.1",
"cordova-plugin-file": "4.3.3",
"cordova-plugin-file-opener2": "2.0.19",
"cordova-plugin-firebase": "0.1.25",
"cordova-plugin-globalization": "1.0.9",
"cordova-plugin-googleplus": "5.2.1",
"cordova-plugin-inappbrowser": "1.7.2",
"cordova-plugin-ionic-webview": "1.1.16",
"cordova-plugin-local-notification": "0.9.0-beta.2",
"cordova-plugin-network-information": "2.0.1",
"cordova-plugin-screen-orientation": "2.0.2",
"cordova-plugin-splashscreen": "4.1.0",
"cordova-plugin-statusbar": "2.3.0",
"cordova-plugin-whitelist": "1.3.3",
"cordova-plugin-x-socialsharing": "5.2.1",
"cordova-sqlite-storage": "2.1.2",
"es6-promise-plugin": "4.1.0",
"firebase": "4.8.2",
"highcharts": "6.0.2",
"highcharts-more": "0.1.2",
"ionic-angular": "3.9.2",
"ionic-img-viewer": "2.7.3",
"ionic-plugin-keyboard": "2.2.1",
"ionic2-rating": "1.2.2",
"ionicons": "3.0.0",
"lodash": "4.17.5",
"moment": "2.19.3",
"mx.ferreyra.callnumber": "0.0.2",
"ng2-truncate": "1.3.11",
"papaparse": "4.3.7",
"rxjs": "5.5.2",
"sw-toolbox": "3.6.0",
"text-mask-addons": "3.6.0",
"zone.js": "0.8.18"
},
"devDependencies": {
"#ionic/app-scripts": "3.1.8",
"typescript": "2.4.2"
},
"description": "An Ionic project",
"cordova": {
"plugins": {
"cordova-plugin-device": {},
"cordova-plugin-splashscreen": {},
"cordova-plugin-statusbar": {},
"cordova-plugin-whitelist": {},
"ionic-plugin-keyboard": {},
"cordova-sqlite-storage": {},
"cordova-plugin-ionic-webview": {},
"cordova-plugin-camera": {
"CAMERA_USAGE_DESCRIPTION": " ",
"PHOTOLIBRARY_USAGE_DESCRIPTION": " "
},
"cordova-plugin-contacts": {
"CONTACTS_USAGE_DESCRIPTION": " "
},
"cordova-plugin-x-socialsharing": {},
"mx.ferreyra.callnumber": {},
"call-number": {},
"cordova-plugin-screen-orientation": {},
"cordova-plugin-inappbrowser": {},
"cordova-plugin-firebase": {},
"cordova-plugin-apprate": {},
"cordova-plugin-file": {},
"cordova-plugin-file-opener2": {},
"cordova-plugin-local-notification": {},
"cordova-plugin-facebook4": {
"APP_ID": "247328495802670",
"APP_NAME": "Budget My Reno"
},
"cordova-plugin-googleplus": {
"REVERSED_CLIENT_ID": "com.googleusercontent.apps.593814858306-cd06l64ddacucewsde34aqw22nb"
},
"cordova-plugin-globalization": {},
"cordova-plugin-compat": {},
"cordova-plugin-network-information": {}
},
"platforms": [
"android",
"ios"
]
}
}
You need to do two things:
Replace cordova-plugin-badge": "file:node_modules\\cordova-plugin-badge declaration in your package.json to package from npm repository.
So as you upgraded node version, you need to rebuild native extensions. The easiest way to do this, is to remove node_modules folder, clean npm cache and install dependencies from the scratch: rm -rf node_modules && npm cache verify && npm i

ionic Cannot find module 'firebase/app' even if it is installed

I've cloned a working Ionic project from github and installed all the modules needed, also using npm install #firebase/app, but when running Ionic serve an error page is shown saying Cannot find module 'firebase/app'. When I installed firebase/app, it showed me this in the shell:
I guess there's a problem with the angularfire2 version that causes me the other problem? Which version should I use and how can I downgrade/upgrade that? To install angularfire2 I've simply run npm install angularfire2.
This is my package.json file:
{
"name": "progettoEM",
"version": "0.0.1",
"author": "Ionic Framework",
"homepage": "http://ionicframework.com/",
"private": true,
"scripts": {
"clean": "ionic-app-scripts clean",
"build": "ionic-app-scripts build",
"lint": "ionic-app-scripts lint",
"ionic:build": "ionic-app-scripts build",
"ionic:serve": "ionic-app-scripts serve"
},
"dependencies": {
"#angular/common": "4.4.3",
"#angular/compiler": "4.4.3",
"#angular/compiler-cli": "4.4.3",
"#angular/core": "4.4.3",
"#angular/forms": "4.4.3",
"#angular/http": "4.4.3",
"#angular/platform-browser": "4.4.3",
"#angular/platform-browser-dynamic": "4.4.3",
"#firebase/app": "^0.1.5",
"#ionic-native/camera": "^4.5.2",
"#ionic-native/core": "4.3.0",
"#ionic-native/diagnostic": "^4.5.2",
"#ionic-native/file": "^4.5.2",
"#ionic-native/geolocation": "^4.5.2",
"#ionic-native/google-maps": "^4.5.2",
"#ionic-native/secure-storage": "^4.5.2",
"#ionic-native/splash-screen": "4.3.0",
"#ionic-native/status-bar": "4.3.0",
"#ionic/storage": "2.0.1",
"angularfire2": "^5.0.0-rc.4",
"graphhopper-js-api-client": "^0.9.0-3",
"ionic-angular": "3.7.1",
"ionic-img-viewer": "^2.9.0",
"ionicons": "3.0.0",
"leaflet": "^1.2.0",
"rxjs": "5.4.3",
"sw-toolbox": "3.6.0",
"zone.js": "0.8.18"
},
"devDependencies": {
"#ionic/app-scripts": "3.0.0",
"#ionic/cli-plugin-cordova": "1.6.2",
"#ionic/cli-plugin-ionic-angular": "1.4.1",
"ionic": "3.13.1",
"typescript": "2.3.4"
},
"description": "An Ionic project"
}
How do I resolve this problem?

Resources