Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

You seem to not be depending on "@angular/core and/or "rxjs". This is an error

I am having issue with the nodejs. It's because I tried to migrate from angular 5 to 6, But failed. So, I cannot be able to run or build my project using nodejs. Is there any fix for this issue will be helpful

When I tried to install my npm running the following command:

npm install

I am getting this error:

npm WARN tar ENOENT: no such file or directory, open 'F:\myapp\node_modules\.staging\js-yaml-cb078df5\dist\js-yaml.min.js'
npm WARN tar ENOENT: no such file or directory, open 'F:\myapp\node_modules\.staging\mime-f1f903d1\build\build.js'
npm WARN tar ENOENT: no such file or directory, open 'F:\myapp\node_modules\.staging\mime-f1f903d1\build\test.js'
npm WARN tar ENOENT: no such file or directory, open 'F:\myapp\node_modules\.staging\spdy-transport-91ae40ff\lib\spdy-transport\protocol\base\constants.js'
npm WARN tar ENOENT: no such file or directory, open 'F:\myapp\node_modules\.staging\spdy-transport-91ae40ff\lib\spdy-transport\protocol\base\framer.js'
npm WARN tar ENOENT: no such file or directory, open 'F:\myapp\node_modules\.staging\spdy-transport-91ae40ff\lib\spdy-transport\protocol\base\index.js'
npm WARN tar ENOENT: no such file or directory, open 'F:\myapp\node_modules\.staging\spdy-transport-91ae40ff\lib\spdy-transport\protocol\base\parser.js'
npm WARN tar ENOENT: no such file or directory, open 'F:\myapp\node_modules\.staging\spdy-transport-91ae40ff\lib\spdy-transport\protocol\base\scheduler.js'
npm WARN tar ENOENT: no such file or directory, open 'F:\myapp\node_modules\.staging\spdy-transport-91ae40ff\lib\spdy-transport\protocol\base\utils.js'
npm WARN tar ENOENT: no such file or directory, lstat 'F:\myapp\node_modules\.staging\clean-css-7b0fe6ee\lib\optimizer\level-2\properties'
npm WARN tar ENOENT: no such file or directory, open 'F:\myapp\node_modules\.staging\less-c0c4bd4e\test\less\errors\functions-10-keyword.less'
npm WARN tar ENOENT: no such file or directory, open 'F:\myapp\node_modules\.staging\less-c0c4bd4e\test\less\errors\functions-10-keyword.txt'
npm WARN tar ENOENT: no such file or directory, open 'F:\myapp\node_modules\.staging\less-c0c4bd4e\test\less\errors\functions-11-operation.less'
npm WARN tar ENOENT: no such file or directory, open 'F:\myapp\node_modules\.staging\less-c0c4bd4e\test\less\errors\functions-11-operation.txt'
npm WARN tar ENOENT: no such file or directory, open 'F:\myapp\node_modules\.staging\less-c0c4bd4e\test\less\errors\functions-12-quoted.less'
npm WARN tar ENOENT: no such file or directory, open 'F:\myapp\node_modules\.staging\less-c0c4bd4e\test\less\errors\functions-12-quoted.txt'
npm WARN tar ENOENT: no such file or directory, open 'F:\myapp\node_modules\.staging\less-c0c4bd4e\test\less\errors\functions-13-selector.less'
npm WARN tar ENOENT: no such file or directory, open 'F:\myapp\node_modules\.staging\less-c0c4bd4e\test\less\errors\functions-13-selector.txt'
npm WARN tar ENOENT: no such file or directory, open 'F:\myapp\node_modules\.staging\less-c0c4bd4e\test\less\errors\functions-14-url.less'
npm WARN tar ENOENT: no such file or directory, open 'F:\myapp\node_modules\.staging\less-c0c4bd4e\test\less\errors\functions-14-url.txt'
npm WARN tar ENOENT: no such file or directory, open 'F:\myapp\node_modules\.staging\less-c0c4bd4e\test\less\errors\functions-15-value.less'
npm WARN tar ENOENT: no such file or directory, open 'F:\myapp\node_modules\.staging\less-c0c4bd4e\test\less\errors\functions-15-value.txt'
npm WARN tar ENOENT: no such file or directory, open 'F:\myapp\node_modules\.staging\less-c0c4bd4e\test\less\errors\functions-3-assignment.less'
npm WARN tar ENOENT: no such file or directory, open 'F:\myapp\node_modules\.staging\less-c0c4bd4e\test\less\errors\functions-3-assignment.txt'
npm WARN tar ENOENT: no such file or directory, open 'F:\myapp\node_modules\.staging\less-c0c4bd4e\test\less\errors\functions-4-call.less'
npm WARN tar ENOENT: no such file or directory, open 'F:\myapp\node_modules\.staging\less-c0c4bd4e\test\less\errors\functions-4-call.txt'
npm WARN tar ENOENT: no such file or directory, open 'F:\myapp\node_modules\.staging\less-c0c4bd4e\test\less\errors\functions-5-color-2.less'
npm WARN tar ENOENT: no such file or directory, open 'F:\myapp\node_modules\.staging\less-c0c4bd4e\test\less\errors\functions-5-color-2.txt'
npm WARN tar ENOENT: no such file or directory, open 'F:\myapp\node_modules\.staging\less-c0c4bd4e\test\less\errors\functions-5-color.less'
npm WARN tar ENOENT: no such file or directory, open 'F:\myapp\node_modules\.staging\less-c0c4bd4e\test\less\errors\functions-5-color.txt'
npm WARN tar ENOENT: no such file or directory, open 'F:\myapp\node_modules\.staging\less-c0c4bd4e\test\less\errors\functions-6-condition.less'
npm WARN tar ENOENT: no such file or directory, open 'F:\myapp\node_modules\.staging\less-c0c4bd4e\test\less\errors\functions-6-condition.txt'
npm WARN tar ENOENT: no such file or directory, open 'F:\myapp\node_modules\.staging\less-c0c4bd4e\test\less\errors\functions-7-dimension.less'
npm WARN tar ENOENT: no such file or directory, open 'F:\myapp\node_modules\.staging\less-c0c4bd4e\test\less\errors\functions-7-dimension.txt'
npm WARN tar ENOENT: no such file or directory, open 'F:\myapp\node_modules\.staging\less-c0c4bd4e\test\less\errors\functions-8-element.less'
npm WARN tar ENOENT: no such file or directory, open 'F:\myapp\node_modules\.staging\less-c0c4bd4e\test\less\errors\functions-8-element.txt'
npm WARN tar ENOENT: no such file or directory, open 'F:\myapp\node_modules\.staging\less-c0c4bd4e\test\less\errors\functions-9-expression.less'
npm WARN tar ENOENT: no such file or directory, open 'F:\myapp\node_modules\.staging\less-c0c4bd4e\test\less\errors\functions-9-expression.txt'
npm WARN tar ENOENT: no such file or directory, open 'F:\myapp\node_modules\.staging\less-c0c4bd4e\test\less\errors\import-malformed.less'
npm WARN tar ENOENT: no such file or directory, open 'F:\myapp\node_modules\.staging\less-c0c4bd4e\test\less\errors\import-malformed.txt'
npm WARN tar ENOENT: no such file or directory, open 'F:\myapp\node_modules\.staging\less-c0c4bd4e\test\less\errors\import-missing.less'
npm WARN tar ENOENT: no such file or directory, open 'F:\myapp\node_modules\.staging\less-c0c4bd4e\test\less\errors\import-missing.txt'
npm WARN tar ENOENT: no such file or directory, open 'F:\myapp\node_modules\.staging\less-c0c4bd4e\test\less\errors\import-no-semi.less'
npm WARN tar ENOENT: no such file or directory, open 'F:\myapp\node_modules\.staging\less-c0c4bd4e\test\less\errors\import-no-semi.txt'
npm WARN tar ENOENT: no such file or directory, open 'F:\myapp\node_modules\.staging\less-c0c4bd4e\test\less\errors\import-subfolder1.less'
npm WARN tar ENOENT: no such file or directory, open 'F:\myapp\node_modules\.staging\less-c0c4bd4e\test\less\errors\import-subfolder1.txt'
npm WARN tar ENOENT: no such file or directory, open 'F:\myapp\node_modules\.staging\less-c0c4bd4e\test\less\errors\import-subfolder2.less'
npm WARN tar ENOENT: no such file or directory, open 'F:\myapp\node_modules\.staging\less-c0c4bd4e\test\less\errors\import-subfolder2.txt'
npm WARN tar ENOENT: no such file or directory, open 'F:\myapp\node_modules\.staging\node-sass-f213465e\src\libsass\src\values.cpp'
npm WARN tar ENOENT: no such file or directory, open 'F:\myapp\node_modules\.staging\node-sass-f213465e\src\libsass\src\util.hpp'
npm WARN tar ENOENT: no such file or directory, open 'F:\myapp\node_modules\.staging\node-sass-f213465e\src\libsass\src\values.hpp'
npm WARN tar ENOENT: no such file or directory, open 'F:\myapp\node_modules\.staging\node-sass-f213465e\src\sass_types\value.h'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\right-align):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: Cannot cd into 'F:\myapp\node_modules\.staging\right-align-7384ea42'

npm ERR! code EINTEGRITY
npm ERR! sha1-If1bBZdltIyYI+Bc/kcMzdgW6LE= integrity checksum failed when using sha1: wanted sha1-If1bBZdltIyYI+Bc/kcMzdgW6LE= but got sha1-8FZUYK0JFXYydrTJV8KmuPo186I=. (111478 bytes)
npm WARN tar ENOENT: no such file or directory, lstat 'F:\myapp\node_modules\.staging\@angular\common-3ad65df7\esm2015\http\testing'

And also when I run the following command:

npm start

I have another error:

> [email protected] start F:\myapp
> ng serve

Could not find module "@angular-devkit/build-angular" from "F:\\myapp".
Error: Could not find module "@angular-devkit/build-angular" from "F:\\myapp".
    at Object.resolve (C:\Users\Kousic\AppData\Roaming\npm\node_modules\@angular\cli\node_modules\@angular-devkit\core\node\resolve.js:141:11)
    at Observable.rxjs_1.Observable [as _subscribe] (C:\Users\Kousic\AppData\Roaming\npm\node_modules\@angular\cli\node_modules\@angular-devkit\architect\src\architect.js:132:40)
    at Observable.subscribe (C:\Users\Kousic\AppData\Roaming\npm\node_modules\@angular\cli\node_modules\rxjs\internal\Observable.js:162:69)
    at DoOperator.call (C:\Users\Kousic\AppData\Roaming\npm\node_modules\@angular\cli\node_modules\rxjs\internal\operators\tap.js:71:23)
    at Observable.subscribe (C:\Users\Kousic\AppData\Roaming\npm\node_modules\@angular\cli\node_modules\rxjs\internal\Observable.js:159:22)
    at C:\Users\Kousic\AppData\Roaming\npm\node_modules\@angular\cli\node_modules\rxjs\internal\util\subscribeTo.js:22:31
    at Object.subscribeToResult (C:\Users\Kousic\AppData\Roaming\npm\node_modules\@angular\cli\node_modules\rxjs\internal\util\subscribeToResult.js:7:45)
    at MergeMapSubscriber._innerSub (C:\Users\Kousic\AppData\Roaming\npm\node_modules\@angular\cli\node_modules\rxjs\internal\operators\mergeMap.js:132:38)
    at MergeMapSubscriber._tryNext (C:\Users\Kousic\AppData\Roaming\npm\node_modules\@angular\cli\node_modules\rxjs\internal\operators\mergeMap.js:129:14)
    at MergeMapSubscriber._next (C:\Users\Kousic\AppData\Roaming\npm\node_modules\@angular\cli\node_modules\rxjs\internal\operators\mergeMap.js:112:18)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: `ng serve`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start 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:\Users\Kousic\AppData\Roaming\npm-cache\_logs\2018-05-15T11_01_47_585Z-debug.log

This is my package.json:

    {
  "name": "myapp",
  "version": "0.0.0",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "^6.0.0",
    "@angular/common": "^6.0.0",
    "@angular/compiler": "^6.0.0",
    "@angular/core": "^6.0.0",
    "@angular/forms": "^6.0.0",
    "@angular/http": "^6.0.0",
    "@angular/platform-browser": "^6.0.0",
    "@angular/platform-browser-dynamic": "^6.0.0",
    "@angular/router": "^6.0.0",
    "core-js": "^2.5.4",
    "rxjs": "^6.0.0",
    "zone.js": "^0.8.26"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "^0.6.1",
    "@angular/cli": "~6.0.1",
    "@angular/compiler-cli": "^6.0.0",
    "@angular/language-service": "^6.0.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": "~1.7.1",
    "karma-chrome-launcher": "~2.2.0",
    "karma-coverage-istanbul-reporter": "~1.4.2",
    "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"
  }
}
like image 433
Kousic Avatar asked May 15 '18 11:05

Kousic


1 Answers

first try:

npm cache clean --force

to make sure everything is consistent.then try

npm install --update-binary --no-shrinkwrap

regenerate and versionned a fresh npm-shrinkwrap.json after these operations.

then : remove package-lock.json and the npm i

like image 109
Fateme Fazli Avatar answered Nov 16 '22 09:11

Fateme Fazli