Can't install dependencies via npm in Angular 2 - angularjs

I have downloaded Angular 2 from main site (quickproject) but I have a lot of problems with install additional libraries. When, for example I try to install angular2-modal module I get:
npm install angular2-modal --save
angular-quickstart#1.0.0 C:\WebServ\httpd\quickstart
`-- angular2-modal#2.0.2
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#^1.0.0 (node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.0.17: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN #angular/upgrade#2.2.4 requires a peer of #angular/core#2.2.4 but none was installed.
npm WARN #angular/upgrade#2.2.4 requires a peer of #angular/compiler#2.2.4 but none was installed.
npm WARN #angular/upgrade#2.2.4 requires a peer of #angular/platform-browser#2.2.4 but none was installed.
npm WARN #angular/upgrade#2.2.4 requires a peer of #angular/platform-browser-dynamic#2.2.4 but none was installed.
I cannot install anything because of this fsevents I think. When I tried to do
npm update
I received
npm update --save
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "D:\\Program Files\\nodejs\\node.exe" "D:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "update" "--save"
npm ERR! node v6.9.2
npm ERR! npm v3.10.9
npm ERR! code EBADPLATFORM
npm ERR! notsup Unsupported platform for fsevents#1.0.17: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm ERR! notsup Valid OS: darwin
npm ERR! notsup Valid Arch: any
npm ERR! notsup Actual OS: win32
npm ERR! notsup Actual Arch: x64
npm ERR! Please include the following file with any support request:
npm ERR! C:\WebServ\httpd\quickstart\npm-debug.log
How to repair it?
{
"name": "angular-quickstart",
"version": "1.0.0",
"description": "QuickStart package.json from the documentation, supplemented with testing support",
"scripts": {
"start": "tsc && concurrently \"tsc -w\" \"lite-server\" ",
"e2e": "tsc && concurrently \"http-server -s\" \"protractor protractor.config.js\" --kill-others --success first",
"lint": "tslint ./app/**/*.ts -t verbose",
"lite": "lite-server",
"pree2e": "webdriver-manager update",
"test": "tsc && concurrently \"tsc -w\" \"karma start karma.conf.js\"",
"test-once": "tsc && karma start karma.conf.js --single-run",
"tsc": "tsc",
"tsc:w": "tsc -w"
},
"keywords": [],
"author": "",
"license": "MIT",
"dependencies": {
"#angular/common": "^2.4.3",
"#angular/compiler": "^2.4.3",
"#angular/core": "^2.4.3",
"#angular/forms": "^2.4.3",
"#angular/http": "^2.4.3",
"#angular/platform-browser": "^2.4.3",
"#angular/platform-browser-dynamic": "^2.4.3",
"#angular/router": "^3.4.3",
"#angular/upgrade": "^2.2.4",
"#swimlane/ngx-datatable": "^5.0.0",
"#types/jasmine": "^2.5.41",
"#types/node": "^6.0.60",
"angular-datatables": "^2.0.1",
"angular-in-memory-web-api": "~0.2.4",
"angular2-datatable": "^0.5.2",
"fsevents": "^1.0.0",
"angular2-modal": "^2.0.2",
"core-js": "^2.4.1",
"datatables.net": "^2.1.1",
"datatables.net-dt": "^2.1.1",
"jquery": "^3.1.1",
"karma": "^1.4.0",
"rxjs": "^5.0.3",
"systemjs": "0.19.40",
"zone.js": "^0.7.6"
},
"devDependencies": {
"concurrently": "^3.1.0",
"lite-server": "^2.2.2",
"typescript": "~2.0.10",
"canonical-path": "0.0.2",
"http-server": "^0.9.0",
"tslint": "^3.15.1",
"lodash": "^4.16.4",
"jasmine-core": "~2.4.1",
"karma": "^1.3.0",
"karma-chrome-launcher": "^2.0.0",
"karma-cli": "^1.0.1",
"karma-jasmine": "^1.0.2",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "~4.0.14",
"rimraf": "^2.5.4",
"#types/node": "^6.0.46",
"#types/jasmine": "^2.5.36"
},
"repository": {}
}

fsevents is an OS X specific API that handles file notification events better on that operating system. Since you are on Windows, you can't run fsevents. It's OS X only.
The npm WARN messages you get are just warnings. It's skipping the optional fsevents dependency that you can't install on your OS. Some of the other warnings you get are a version mismatch between the Angular2 you want to install (2.4.3) and the one that angular2-modal wants as a peer (2.2.4), but this should probably work okay.
Remove fsevents from package.json. Some other dependencies may try to install it on OS X, but you don't need to include it as a core dependency of your project.

Delete everything from node_modules. run "npm install" from terminal. then try to run "npm start". Make sure you have installed latest version of node & npm

Simple steps for downloading working Angular2 via NPM
Install NPM into your system
Install node.js into your system
Now follow follwing steps :-
Note :- For install Angular2 CLI globally
Command : npm install -g #angular/cli
Step.1 npm install --save-dev #angular/cli#latest ( install angular dependencies )
Step.2 ng new my-app ( Creating New Angular2 Project )
Step.3 cd my-app ( Comes to your project path )
Step.4 ng serve --open ( This command is for launching the server )
Open Your Angular2 project :- http://localhost:4200/

Related

npm install is giving us a Dependency Tree Error

i made a commit to a repo today and when we tried to start the server it gave an error from react.script named "Type Error: chalk.constructor is not a constructor" as a fix we tried to delete lock files (we had both yarn and npm lock) and delete node modules files, and after an npm install after that, it gave us this error:
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: react-scripts#3.4.1
npm ERR! Found: typescript#4.0.8
npm ERR! node_modules/typescript
npm ERR! typescript#"~4.0.2" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peerOptional typescript#"^3.2.1" from react-scripts#3.4.1
npm ERR! node_modules/react-scripts
npm ERR!
npm ERR! Conflicting peer dependency: typescript#3.9.10
npm ERR! node_modules/typescript
npm ERR! peerOptional typescript#"^3.2.1" from react-scripts#3.4.1
npm ERR! node_modules/react-scripts
npm ERR! react-scripts#"3.4.1" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See *** for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! ***
PS *** npm install
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: react-scripts#3.4.1
npm ERR! Found: typescript#4.0.8
npm ERR! node_modules/typescript
npm ERR! typescript#"~4.0.2" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peerOptional typescript#"^3.2.1" from react-scripts#3.4.1
npm ERR! node_modules/react-scripts
npm ERR! react-scripts#"3.4.1" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: typescript#3.9.10
npm ERR! peerOptional typescript#"^3.2.1" from react-scripts#3.4.1
npm ERR! node_modules/react-scripts
npm ERR! react-scripts#"3.4.1" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See *** for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! ***
I censored the paths for privacy purposes. But after that i changed typescript package version to typescript#"^3.2.1" and it still didn't work, after that i used the "npm install --save --legacy-peer-deps" command and it still didn't work. Can anyone please offer any advice?
Update: The package.json is below
{
"name": "company-name",
"version": "0.1.0",
"private": true,
"dependencies": {
"#material-ui/core": "^4.11.0",
"#material-ui/icons": "^4.9.1",
"#material-ui/lab": "^4.0.0-alpha.56",
"#material-ui/styles": "^4.10.0",
"#react-pdf/renderer": "2.0.0-beta.6",
"#testing-library/jest-dom": "^4.2.4",
"#testing-library/react": "^9.3.2",
"#testing-library/user-event": "^7.1.2",
"#tinymce/tinymce-react": "^3.6.1",
"#types/file-saver": "^2.0.1",
"#types/html2canvas": "^0.0.35",
"#types/jest": "^24.0.0",
"#types/jspdf": "^1.3.3",
"#types/node": "^12.0.0",
"#types/react": "^16.9.0",
"#types/react-color": "^3.0.4",
"#types/react-dom": "^16.9.0",
"#types/react-notifications-component": "^2.4.0",
"#types/react-redux": "^7.1.9",
"#types/react-router-dom": "^5.1.5",
"#types/react-text-mask": "^5.4.6",
"#types/react-virtualized": "^9.21.10",
"#types/uuid": "^8.3.0",
"#types/yup": "^0.29.3",
"axios": "^0.19.2",
"bootstrap": "^4.5.0",
"computed-style-to-inline-style": "^3.0.0",
"file-saver": "^2.0.2",
"font-awesome": "^4.7.0",
"fontsource-roboto": "3.0.3",
"formik": "^2.1.5",
"fs": "^0.0.1-security",
"html-to-image": "^1.6.1",
"html2canvas": "^1.0.0-rc.7",
"jquery": "^3.5.1",
"js-file-download": "^0.4.12",
"jspdf": "^1.5.3",
"moment": "^2.27.0",
"popper.js": "^1.16.1",
"potrace": "^2.1.6",
"react": "^16.13.1",
"react-bootstrap": "^1.0.1",
"react-bootstrap-sweetalert": "^5.2.0",
"react-color": "^2.18.1",
"react-credit-card-input": "^1.1.5",
"react-dom": "^16.13.1",
"react-material-ui-carousel": "^2.0.0",
"react-notifications-component": "^2.4.0",
"react-player": "^2.4.0",
"react-recaptcha": "^2.3.10",
"react-redux": "^7.2.0",
"react-responsive-carousel": "^3.2.9",
"react-router-dom": "^5.2.0",
"react-router-hash-link": "^2.3.1",
"react-scripts": "3.4.1",
"react-text-mask": "^5.4.3",
"react-virtualized": "^9.22.2",
"redux-thunk": "^2.3.0",
"styled-components": "^5.2.0",
"sweetalert2": "^11.1.0",
"typescript": "~4.0.2",
"uuid": "^8.3.0",
"xlsx": "^0.17.0",
"yup": "^0.29.1"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject",
"prod": "serve -s build -l 3000",
"build-run-prod": "react-scripts build && serve -s build -l 3000"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}

React full stack app deploy to Google App Engine with error webpack: not found

everyone. I try to deploy Reack full stack app from https://github.com/crsandeep/simple-react-full-stack
And it doesn't work. I read too many posts about deploying react to gcloud but there are simple apps and not full stack apps.
my packege.json, I took it from git
{
"name": "simple-react-full-stack",
"version": "1.0.0",
"description": "Boilerplate to build a full stack web application using React, Node.js, Express and Webpack.",
"main": "src/server/index.js",
"scripts": {
"build": "webpack --mode production",
"start": "npm run build && node src/server/index.js",
"client": "webpack-dev-server --mode development --devtool inline-source-map --hot",
"server": "nodemon src/server/index.js",
"dev": "concurrently \"npm run server\" \"npm run client\""
},
"author": "Sandeep Raveesh",
"license": "ISC",
"dependencies": {
"babel-polyfill": "^6.26.0",
"express": "^4.16.3",
"react": "^16.5.2",
"react-dom": "^16.5.2"
},
"devDependencies": {
"#babel/core": "^7.0.0",
"#babel/plugin-proposal-class-properties": "^7.0.0",
"#babel/preset-env": "^7.0.0",
"#babel/preset-react": "^7.0.0",
"babel-eslint": "^10.0.0",
"babel-loader": "^8.0.0",
"clean-webpack-plugin": "^1.0.0",
"concurrently": "^4.0.0",
"css-loader": "^2.0.0",
"eslint": "^5.0.0",
"eslint-config-airbnb": "^17.0.0",
"eslint-plugin-import": "^2.11.0",
"eslint-plugin-jsx-a11y": "^6.0.3",
"eslint-plugin-react": "^7.7.0",
"file-loader": "^3.0.0",
"html-webpack-plugin": "^3.2.0",
"nodemon": "^1.17.3",
"style-loader": "^0.23.0",
"url-loader": "^1.0.1",
"webpack": "^4.5.0",
"webpack-cli": "^3.0.8",
"webpack-dev-server": "^3.1.3"
}
}
my app.yaml I took it from google
env: flex
runtime: nodejs
I run in terminal
gcloud beta app deploy
And I have error
Updating service [default] (this may take several minutes)...failed.
ERROR: (gcloud.beta.app.deploy) Error Response: [9]
Application startup error:
> simple-react-full-stack#1.0.0 prestart /app
> npm run bundle
> simple-react-full-stack#1.0.0 bundle /app
> webpack --config webpack.config.js
sh: 1: webpack: not found
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! simple-react-full-stack#1.0.0 bundle: `webpack --config webpack.config.js`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the simple-react-full-stack#1.0.0 bundle 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! /root/.npm/_logs/2019-12-04T18_45_03_238Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! simple-react-full-stack#1.0.0 prestart: `npm run bundle`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the simple-react-full-stack#1.0.0 prestart 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! /root/.npm/_logs/2019-12-04T18_45_03_252Z-debug.log
I don't understand what it need, I tried to add "npm install" and it doesn't work too.
How fix it?
Here is a community tutorial you can follow, get everything working as described first and then start making the desired edits.
Please make sure you are following the steps of "Preparing the app" section, as it seems like you are missing on of the mentioned steps.
npm init
npm install --save webpack express pug
As well as modifying package.json to include:
"scripts": {
"bundle": "webpack --config webpack.config.js",
"prestart": "npm run bundle"
}
Also note that:
Webpack must be listed in the dependencies of the package.json file,
as by default devDependencies are not installed when the app is
deployed to Google App Engine.
Also keep in mind that gcloud beta app deploy is still in BETA and may have changes without notice. So for what you are trying to achieve there is no need for using beta. Instead simply use gcloud app deploy.

React Project installation always fails at inotify (ELIFECYCLE errno 1)

I'm trying to install a ReactJs Project on Ubuntu 19.04. For some reason, the installation always seems to fail at a certain package called inotify.
I'm currently on node v12.10.0 and npm v6.10.3
I've tried several things and even tried to install inotify individually, but nothing seems to have worked. I still have no clue about the reason for this issue.
This is my package.json file.
{
"name": "im-lite",
"version": "0.1.0",
"private": true,
"homepage": "http://localhost/React-Redux/im-lite/build",
"devDependencies": {
"babel-core": "^6.26.3",
"babel-loader": "^7.1.5",
"css-loader": "^0.23.1",
"dev": "0.1.3",
"react-scripts": "^2.1.1",
"style-loader": "^0.13.1"
},
"dependencies": {
"babel-core": "^6.26.3",
"babel-loader": "^7.1.5",
"babel-polyfill": "^6.26.0",
"babel-preset-env": "^1.7.0",
"babel-preset-es2015": "^6.24.0",
"babel-preset-react": "^6.23.0",
"babel-register": "^6.24.1",
"bcrypt": "^1.0.2",
"body-parser": "^1.17.1",
"compression": "^1.7.1",
"constants": "0.0.2",
"cookie-parser": "^1.4.3",
"cors": "^2.8.3",
"css-loader": "^0.23.1",
"debug": "^2.6.6",
"encoding": "^0.1.12",
"express": "^4.15.2",
"express-status-monitor": "^1.1.4",
"extract-text-webpack-plugin": "^2.1.0",
"file-loader": "^0.10.1",
"floating-label-react": "^0.2.0",
"formidable": "^1.1.1",
"fs": "0.0.1-security",
"geoip-lite": "^1.2.1",
"http": "0.0.0",
"import-export": "^1.0.1",
"inherits": "^2.0.3",
"ipaddr.js": "^1.3.0",
"isomorphic-fetch": "^2.2.1",
"json-loader": "^0.5.7",
"loader-utils": "^1.1.0",
"mime": "^2.3.1",
"next": "^6.1.1",
"node-env-file": "^0.1.8",
"node-fetch": "^1.6.3",
"path": "^0.12.7",
"preact": "^8.2.6",
"preact-compat": "^3.17.0",
"qs": "^6.4.0",
"query-string": "^6.1.0",
"react": "^15.5.4",
"react-addons-update": "^15.5.2",
"react-adsense": "0.0.5",
"react-alice-carousel": "^1.13.11",
"react-dom": "^15.5.4",
"react-helmet": "^5.2.0",
"react-hot-loader": "^1.3.1",
"react-html-parser": "^1.0.3",
"react-lazy-load": "^3.0.13",
"react-player": "^1.11.0",
"react-redux": "^5.0.4",
"react-responsive-carousel": "^3.1.49",
"react-router": "^3.0.5",
"react-share": "^2.4.0",
"react-toolbox": "^2.0.0-beta.7",
"react-virtualized": "^9.7.5",
"redux": "^3.6.0",
"redux-infinite-scroll": "^1.0.9",
"redux-thunk": "^2.2.0",
"register": "0.0.0",
"request": "^2.81.0",
"request-ip": "^2.0.2",
"serviceworker-webpack-plugin": "^0.2.1",
"style-loader": "^0.13.2",
"sw-precache-webpack-plugin": "^0.9.1",
"uglifyjs-webpack-plugin": "^0.4.6",
"url": "^0.11.0",
"url-loader": "^1.1.2",
"url-parse": "^1.4.1",
"uuid": "^3.0.1",
"webpack": "^4.27.1",
"webpack-dev-middleware": "^1.10.2",
"webpack-hot-middleware": "^2.18.0"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom"
}
}
This is the stack trace when I execute sudo npm-install
npm WARN deprecated fsevents#1.2.4: Way too old
inotify#1.4.6 install /home/vaibhav/Desktop/im/mobile-im-pw/im-lite/node_modules/inotify
node-gyp rebuild
gyp ERR! configure error
gyp ERR! stack Error: EACCES: permission denied, mkdir '/home/vaibhav/Desktop/im/mobile-im-pw/im-lite/node_modules/inotify/build'
gyp ERR! System Linux 5.0.0-29-generic
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/vaibhav/Desktop/im/mobile-im-pw/im-lite/node_modules/inotify
gyp ERR! node -v v12.10.0
gyp ERR! node-gyp -v v5.0.3
gyp ERR! not ok
npm WARN #babel/helper-create-class-features-plugin#7.6.0 requires a peer of #babel/core#^7.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN #babel/plugin-transform-named-capturing-groups-regex#7.6.0 requires a peer of #babel/core#^7.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN acorn-jsx#5.0.2 requires a peer of acorn#^6.0.0 || ^7.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN babel-plugin-named-asset-import#0.3.4 requires a peer of #babel/core#^7.1.0 but none is installed. You must install peer dependencies yourself.
npm WARN extract-text-webpack-plugin#2.1.2 requires a peer of webpack#^2.2.0 but none is installed. You must install peer dependencies yourself.
npm WARN next#6.1.2 requires a peer of react#^16.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN next#6.1.2 requires a peer of react-dom#^16.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN serviceworker-webpack-plugin#0.2.3 requires a peer of webpack#1 || ^2 || ^3 but none is installed. You must install peer dependencies yourself.
npm WARN sw-precache-webpack-plugin#0.9.2 requires a peer of webpack#^1 || ^2 || ^2.1.0-beta || ^2.2.0-beta but none is installed. You must install peer dependencies yourself.
npm WARN ts-pnp#1.1.4 requires a peer of typescript#* but none is installed. You must install peer dependencies yourself.
npm WARN uglifyjs-webpack-plugin#0.4.6 requires a peer of webpack#^1.9 || ^2 || ^2.1.0-beta || ^2.2.0-rc || ^3.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN webpack-dev-middleware#1.12.2 requires a peer of webpack#^1.0.0 || ^2.0.0 || ^3.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN The package babel-core is included as both a dev and production dependency.
npm WARN The package babel-loader is included as both a dev and production dependency.
npm WARN The package css-loader is included as both a dev and production dependency.
npm WARN The package style-loader is included as both a dev and production dependency.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.4 (node_modules/react-scripts/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.9 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! inotify#1.4.6 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the inotify#1.4.6 install 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/vaibhav/.npm/_logs/2019-09-23T12_00_42_775Z-debug.log
What am I doing wrong?

Ubuntu how to run ng commnd

In Ubuntu 16.04, I have installed nodejs with the following command:
sudo apt-get update
sudo apt-get install nodejs
sudo apt-get install npm
To confirm, I used the command which nodejs and it returns
/usr/bin/nodejs
I want to run an Angular project. I have also created 'node_modules' folder and updated the 'Angular CLI'. However, the ng command is not working in terminal.
Edited
Below is my package.json content:
{
"name": "angular",
"version": "0.0.0",
"license": "MIT",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"#angular-devkit/core": "^0.2.0",
"#angular/animations": "^5.0.0",
"#angular/common": "^5.0.0",
"#angular/compiler": "^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",
"#angular/router": "^5.0.0",
"bootstrap": "^3.3.7",
"core-js": "^2.4.1",
"rxjs": "^5.5.2",
"zone.js": "^0.8.14"
},
"devDependencies": {
"#angular/cli": "^1.6.7",
"#angular/compiler-cli": "^5.0.0",
"#angular/language-service": "^5.0.0",
"#types/jasmine": "~2.5.53",
"#types/jasminewd2": "~2.0.2",
"#types/node": "~6.0.60",
"codelyzer": "^4.0.1",
"jasmine-core": "~2.6.2",
"jasmine-spec-reporter": "~4.1.0",
"karma": "~1.7.0",
"karma-chrome-launcher": "~2.1.1",
"karma-cli": "~1.0.1",
"karma-coverage-istanbul-reporter": "^1.2.1",
"karma-jasmine": "~1.1.0",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "~5.1.2",
"ts-node": "~3.2.0",
"tslint": "~5.7.0",
"typescript": "~2.4.2"
}
}
The Blank terminal is given in below screen:
I see after running the command npm install -g #angular/cli the below error comes:
npm ERR! Error: EACCES: permission denied, access '/usr/local/lib' npm
ERR! at Error (native) npm ERR! { [Error: EACCES: permission
denied, access '/usr/local/lib'] npm ERR! errno: -13, npm ERR!
code: 'EACCES', npm ERR! syscall: 'access', npm ERR! path:
'/usr/local/lib' } npm ERR! npm ERR! Please try running this command
again as root/Administrator.
EDITED 2
Now I see after placing ng serve command:
niladri#niladrib:/var/www/html/ngAngular$ ng serve
/usr/local/lib/node_modules/#angular/cli/models/config/config.js:17
constructor(_configPath, schema, configJson, fallbacks = []) {
^
SyntaxError: Unexpected token =
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:374:25)
at Object.Module._extensions..js (module.js:417:10)
at Module.load (module.js:344:32)
at Function.Module._load (module.js:301:12)
at Module.require (module.js:354:17)
at require (internal/module.js:12:17)
at Object. (/usr/local/lib/node_modules/#angular/cli/models/config.js:3:18)
at Module._compile (module.js:410:26)
at Object.Module._extensions..js (module.js:417:10)
Angular-cli has certain prerequisites, which includes node version > 6.9, as can be seen here:
https://github.com/angular/angular-cli#prerequisites
To update node to latest version, we can follow :
https://askubuntu.com/questions/426750/how-can-i-update-my-nodejs-to-the-latest-version
You need to install AngularCLI globally in order to serve up the application using ng serve.
To do this run the following command in your terminal:
npm install -g #angular/cli (use sudo if you need administrator privileges on Ubuntu.)
This will install AngularCLI globally. Which you can then simply used to serve the application by navigating to the folder and typing ng s.
check the json package file, look at the script section, write the text after start in your terminal. example in that same file you can see the installed dependencies in the folder node_modules
ok, first write to your terminal ng --version, with this you will get the version of angular cli that you have installed on your desktop and compare it with this "# angular / cli": "^ 1.6.7" if the version of your angular cli at the bottom, update it, the how to do it is in the documentation, after that write in the terminal sudo npm install, so that all the dependencies of the Json package file are installed after running ng serve
hey #Shivi first install npm install -g sass node-sass. this in a global way. then enter the ngAngular folder in install the dependencies with "npm install" and this will be enough after ng serve to run the project. an image that if it runs
enter image description here

Package react does not satisfy its siblings

Was trying to install
sudo npm install react-datagrid --save
sudo npm install react-datepicker --save
Console Output
npm ERR! peerinvalid The package react does not satisfy its siblings' peerDependencies requirements!
npm ERR! peerinvalid Peer react-datagrid#2.0.2 wants react#>=0.14.0
npm ERR! peerinvalid Peer react-dom#15.0.1 wants react#^15.0.1
npm ERR! peerinvalid Peer input-moment#0.1.0 wants react#^0.14.0
npm ERR! peerinvalid Peer react-datepicker#0.26.0 wants react#^0.14.0
npm ERR! System Linux 3.19.0-56-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "react-datagrid" "--save"
npm ERR! cwd /home/shashank/webapps/cms
npm ERR! node -v v0.10.25
npm ERR! npm -v 1.3.10
npm ERR! code EPEERINVALID
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/shashank/webapps/cms/npm-debug.log
npm ERR! not ok code 0
The required dependency is react#^15.0.1 which is already installed can be seen in package.json I do I overcome this issue.
package.json
"devDependencies": {
"babel-core": "^6.7.7",
"babel-loader": "^6.2.4",
"babel-preset-es2015": "^6.5.0",
"babel-preset-react": "^6.5.0",
"babelify": "^7.2.0",
"browserify": "^13.0.0",
"chalk": "^1.1.1",
"gulp": "gulpjs/gulp#4.0",
"gulp-cli": "gulpjs/gulp-cli#4.0",
"gulp-concat": "^2.6.0",
"gulp-cssnano": "^2.1.1",
"gulp-htmlmin": "^1.3.0",
"gulp-if": "^2.0.0",
"gulp-rename": "^1.2.2",
"gulp-replace": "^0.5.4",
"gulp-sourcemaps": "^1.6.0",
"gulp-uglify": "^1.5.3",
"gulp-util": "^3.0.7",
"gulp-watch": "^4.3.5",
"pretty-hrtime": "^1.0.2",
"vinyl-buffer": "^1.0.0",
"vinyl-source-stream": "^1.1.0",
"watchify": "^3.7.0",
"yargs": "^4.1.0"
},
"dependencies": {
"gulp-rename": "^1.2.2",
"moment": "^2.13.0",
"react": "^15.0.1",
"react-datagrid": "^2.0.2",
"react-dom": "^15.0.1"
}
}
you can update last npm that solve your problem
sudo npm install npm -g
Use
"react": "^15.0.1 || ^0.14.0"
I was able to fix the issue by installing a stable version on node I upgraded from v0.10.25 to v4.4.3
Step 1: First Remove the old version of node by finding the location of installation
$ which node ( Finds the path of installations Eg: /usr/bin/nodejs)
$ sudo rm -rf /usr/bin/nodejs
Step 2: Download Stable version of Node (I used node-v4.4.3-linux-x64.tar.gz )
Step 3: Install the stable version of Node in /usr/local/
$ sudo tar -C /usr/local/ --strip-components 1 -xzf node-v4.4.3-linux-x64.tar.gz
VoilĂ 

Resources