npm install: install Couldn't read dependencies - javascript

I have started to learn Angular JS. I am going through this, that is building simple phonecat app
I am following the steps. Node.js downloaded.
Trying to execute this command: npm install
Error occured:
C:>npm install
npm ERR! install Couldn't read dependencies
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Program Files (x86)\\nodejs\\\\node.exe" "C:\\Program Files (
x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! node v0.12.4
npm ERR! npm v2.10.1
npm ERR! path C:\package.json
npm ERR! code ENOPACKAGEJSON
npm ERR! errno -4058
npm ERR! package.json ENOENT, open 'C:\package.json'
npm ERR! package.json This is most likely not a problem with npm itself.
npm ERR! package.json npm can't find a package.json file in your current directo
ry.
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Program Files (x86)\\nodejs\\\\node.exe" "C:\\Program Files (
x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! node v0.12.4
npm ERR! npm v2.10.1
npm ERR! Uncaught, unspecified "error" event.
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! C:\npm-debug.log
C:\>

Before executing the command npm install
Execute this cd myproject and then execute this: npm install
Its solved. Thanks.

It looks like you haven't put the package.json file in root directory.
If you are starting fresh, you'll need to clone this repo. https://github.com/angular/angular-phonecat

Like Bilhan A said: you need to change to the folder where you cloned the project to.
From your question I am assuming you are new to programming and want to learn Angularjs primarily. Node.js is not needed for this. If you really want to learn Angular, I recommend Tutorials like this one, which do not require node.js. When you understood how it works, come back to node.js and combine them.

name field in package.json should be the same with name of your project directory.

If this is the error displayed then simply update the npm,i face this issue now that's why i update here,it might be help some one
$ npm install
npm ERR! install Couldn't read dependencies
npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe"
"C:\\Program F iles\\nodejs\\node_modules\\npm\\bin\\npm-cli.js"
"install"
npm ERR! node v4.4.5
npm ERR! npm v2.15.5
npm ERR! path C:\Users\joy\package.json
npm ERR! code ENOPACKAGEJSON
npm ERR! errno -4058
npm ERR! syscall open
npm ERR! package.json ENOENT: no such file or directory, open
npm ERR! package.json This is most likely not a problem with npm itself.
npm ERR! package.json npm can't find a package.json file in your current
npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\joy\Desktop\TEMP\node\chatsys\npm-debug.log

Related

How can I fix this npm error? npm ERR! Windows_NT 10.0.19042

I had no errors when I downgraded to npm#3.10.10 I got this error that keeps showing every time I use npm to update it self or to install anything new, What can I do?
npm ERR! Windows_NT 10.0.19042
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\usr\\local\\node_modules\\npm\\bin\\npm-cli.js" "i" "-g" "npm#latest"
npm ERR! node v14.17.1
npm ERR! npm v3.10.10
npm ERR! cb.apply is not a function
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! C:\Users\hp\Documents\npm-debug.log
Option 1:
Follow this directory
C:\Users(your username)\AppData\Roaming
Delete the npm folder and if there is one npm cache folder.
Run npm clean cache —force ( — force is now required to clean cache)
You should be good now if not do option 2.
Option 2:
Follow this directory
C:\Users(your username)\AppData\Roaming
Delete the npm folder and if there is one mom cache folder.
Run npm clean cache —force ( — force is now required to clean cache)
Make sure everything to do with Nodejs is deleted and uninstalled.
Reinstall Nodejs.
You should be good now.
https://github.com/nodejs/help/issues/2874

error TS5023: Unknown compiler option moduleResolution, lib after npm start

I have a issue when I try call npm start in Angular 2 project. Console show me:
$ npm start
angular-quickstart#1.0.0 prestart C:\Users\Jan\Desktop\Study\ZTW lab\Ang\myApp
npm run build
angular-quickstart#1.0.0 build C:\Users\Jan\Desktop\Study\ZTW lab\Ang\myApp
tsc -p src/
**error TS5023: Unknown compiler option 'moduleResolution'.**
**error TS5023: Unknown compiler option 'lib'.**
npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "build"
npm ERR! node v6.10.1
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! angular-quickstart#1.0.0 build: `tsc -p src/`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the angular-quickstart#1.0.0 build script 'tsc -p src/'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the angular-quickstart package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! tsc -p src/
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs angular-quickstart
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls angular-quickstart
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\Jan\Desktop\Study\ZTW lab\Ang\myApp\npm-debug.log
npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "start"
npm ERR! node v6.10.1
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! angular-quickstart#1.0.0 prestart: `npm run build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the angular-quickstart#1.0.0 prestart script 'npm run build'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the angular-quickstart package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! npm run build
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs angular-quickstart
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls angular-quickstart
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\Jan\Desktop\Study\ZTW lab\Ang\myApp\npm-debug.log
Any idea?
It's very strange because 2 days ago everything was ok. I created a new project based on the QuickStart .
I called npm install and npm start and I was working with project. Today unluckily npm start don't work and I get this error :/ Thanks advance for help.

Installing angular2-localstorage in WebStorm gives error regarding "typings install"

I am using windows and WebStorm. Tried to install angular2-localstorage with npm install angular2-localstorage but got an error.
The angular2-localstorage project is not maintained, so I'm posting here.
https://github.com/marcj/angular2-localStorage
Error details:
npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "angular2-localstorage"
npm ERR! node v6.10.0
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! angular2-localstorage#0.4.0 postinstall: `typings install`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the angular2-localstorage#0.4.0 postinstall script 'typings install'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the angular2-localstorage package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! typings install
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs angular2-localstorage
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls angular2-localstorage
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\***\WebstormProjects\ReusGooRoo2\npm-debug.log
The log file contents: http://pastebin.com/njG9XMgK
Any help appreciated.
Since the node module angular2-localstorage is not maintained properly, I would recommend angular-2-local-storage node_module as an alternative.
Steps:
Install npm install angular-2-local-storage
Make sure that the package is added in the config.js(systemjs or webpack)
Import the module and service as below
import { LocalStorageModule,LocalStorageService} from 'angular-2-local-storage';
Add the module to imports array and service to providers array as
imports: [ BrowserModule,
LocalStorageModule.withConfig({storageType: 'localStorage'}), ],
providers:[LocalStorageService],
Inject the Service as a dependency into component as below
constructor(private localStorageService: LocalStorageService) {
this.name = 'Angular-2-Local-Storage-Demo';
this.localStorageService.add('a',this.user);
console.log(this.localStorageService.get('a'));
this.valuFromLocalStorage= this.localStorageService.get('a')
}
LIVE DEMO

Node.js- "npm install express" error:0906D06C :PEM routines : PEM_read_bio npm

I have installed node.js and it has npm installed along with it. In my windows command prompt,when i write "npm install express", it gives me the following error.How to resolve this?
C:\Users>npm -v
2.11.2
C:\Users>npm install express
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\Program Files\nodejs\\node.exe" "C:\Program
Files\nodejs \node_modules\npm\bin\npm-cli.js" "install"
"express"
npm ERR! node v0.12.5
npm ERR! npm v2.11.2
npm ERR! error:0906D06C:PEM routines:PEM_read_bio:no start line
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! C:\Users\npm-debug.log
I also got same problem after setting registry problem got resolved.
cmd>> npm set registry registry.npmjs.org
cmd>> npm install
it worked for me.

Angular js wont install on my machine

I have node.js installed on my machine, I have version: v0.12.0 installed. Following instructions when I use sudo npm install I get these errors:
npm ERR! install Couldn't read dependencies
npm ERR! Darwin 14.0.0
npm ERR! argv "node" "/usr/local/bin/npm" "install"
npm ERR! node v0.12.0
npm ERR! npm v2.6.0
npm ERR! path /Users/aston.haigh/package.json
npm ERR! code ENOPACKAGEJSON
npm ERR! errno -2
npm ERR! package.json ENOENT, open '/Users/aston.haigh/package.json'
npm ERR! package.json This is most likely not a problem with npm itself.
npm ERR! package.json npm can't find a package.json file in your current directory.
npm ERR! Please include the following file with any support request:
npm ERR! /Users/aston.haigh/Projects/astonhaigh.co.uk/npm-debug.log
Ive tried clearing the node cache, updating node and havent had any luck, any ideas?
Seem to fix the issue when i uninstalled node and then reinstall using homebrew. P.s really good tutorial: https://www.youtube.com/watch?v=FqMIyTH9wSg

Categories

Resources