npm install firebase always fails - javascript

when I tried to install firebase it always fails. I wanna to install firebase in my REACTJS project using
`npm i firebase`
and shows this error:
npm WARN tsutils#3.17.1 requires a peer of typescript#>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta but none is installed. You must install peer dependencies yourself.
npm ERR! code EPERM
npm ERR! syscall unlink
npm ERR! path G:\react\netflix\netflix-clone\node_modules\youtube-player\node_modules\debug\src
npm ERR! errno -4048
npm ERR! Error: EPERM: operation not permitted, unlink 'G:\react\netflix\netflix-clone\node_modules\youtube-player\node_modules\debug\src'
npm ERR! [OperationalError: EPERM: operation not permitted, unlink 'G:\react\netflix\netflix-clone\node_modules\youtube-player\node_modules\debug\src'] {
npm ERR! cause: [Error: EPERM: operation not permitted, unlink 'G:\react\netflix\netflix-clone\node_modules\youtube-player\node_modules\debug\src'] {
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'unlink',
npm ERR! path: 'G:\react\netflix\netflix-clone\node_modules\youtube-player\node_modules\debug\src'
npm ERR! },
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'unlink',
npm ERR! path: 'G:\react\netflix\netflix-clone\node_modules\youtube-player\node_modules\debug\src',
npm ERR! parent: 'youtube-player'
npm ERR! }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It's possible that the file was already in use (by a text editor or antivirus),
npm ERR! or that you lack permissions to access it.
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\ADMIN\AppData\Roaming\npm-cache_logs\2020-09-20T07_03_09_714Z-debug.log
my package.json file is here :
{
"name": "netflix-clone",
"version": "0.1.0",
"private": true,
"dependencies": {
"#testing-library/jest-dom": "^4.2.4",
"#testing-library/react": "^9.5.0",
"#testing-library/user-event": "^7.2.1",
"axios": "^0.20.0",
"movie-trailer": "^2.0.6",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"react-scripts": "3.4.3",
"react-youtube": "^7.12.0"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"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"
]
}
}

This might be a permission issue.
What you can do is that open command line(CMD) as an administrator by right clicking on command line(CMD) and selecting "Run as Administrator".
Once it is opened then navigate to your project folder and then install firebase. Image is added for windows but if you have MAC then do it correspondingly!

Related

Trying to install Material UI v5 causes ' could not resolve dependency errors '

When trying to install material ui get a load of dependency resolution errors. Not quite sure what the cause is. I previously tried to install V4 and got an error, that I thought I would resolve by using V5 because this version of React isn't compatible with V4 but I have no idea about the rest of the conflicts.
npm i #mui/material #emotion/react #emotion/styled
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: #material-ui/core#4.12.4
npm ERR! Found: react#18.2.0
npm ERR! node_modules/react
npm ERR! peer react#"^18.0.0" from #testing-library/react#13.3.0
npm ERR! node_modules/#testing-library/react
npm ERR! dev #testing-library/react#"^13.3.0" from the root project
npm ERR! peer react#">=16" from phosphor-react#1.4.1
npm ERR! node_modules/phosphor-react
npm ERR! dev phosphor-react#"^1.4.1" from the root project
npm ERR! 18 more (react-dom, react-dropzone, react-media, react-popper, ...)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react#"^16.8.0 || ^17.0.0" from #material-ui/core#4.12.4
npm ERR! node_modules/#material-ui/core
npm ERR! #material-ui/core#"^4.12.4" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: react#17.0.2
npm ERR! node_modules/react
npm ERR! peer react#"^16.8.0 || ^17.0.0" from #material-ui/core#4.12.4
npm ERR! node_modules/#material-ui/core
npm ERR! #material-ui/core#"^4.12.4" from the root project
npm ERR!
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
package.json:
{
"name": "wordscramble",
"version": "0.1.0",
"private": true,
"dependencies": {
"#material-ui/core": "^4.12.4",
"#testing-library/jest-dom": "^5.16.4",
"#testing-library/user-event": "^13.5.0",
"bootstrap": "^5.2.0",
"jquery": "^3.6.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-dropzone": "^14.2.2",
"react-media": "^1.10.0",
"react-router": "^6.3.0",
"react-scripts": "5.0.1",
"react-tinder-card": "^1.4.5",
"reactstrap": "^9.1.2",
"web-vitals": "^2.1.4"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"#testing-library/react": "^13.3.0",
"fetch-mock": "^9.11.0",
"msw": "^0.44.2",
"phosphor-react": "^1.4.1",
"react-redux": "^8.0.2",
"react-router-dom": "^6.3.0",
"react-test-renderer": "^18.2.0"
}
}
Any help in identifying any potential conflicts would be greatly appreciated,
thanks!
1- uninstall #material-ui :
npm uninstall #material-ui/core
2 - install Mui v5 :
npm install #mui/material #mui/styled-engine-sc styled-components
Works with --legacy-peer-deps:
npm i #mui/material #emotion/react #emotion/styled --legacy-peer-deps
For more details see react v17 section on this answer https://stackoverflow.com/a/66620869/1515819

Unable to install #mui/x-data-grid in react

npm install #mui/x-data-grid
throws an error
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: highradius#0.1.0
npm ERR! Found: react#18.0.0
npm ERR! node_modules/react
npm ERR! react#"^18.0.0" from the root project
npm ERR! peer react#"^17.0.0 || ^18.0.0" from #mui/material#5.6.0
npm ERR! node_modules/#mui/material
npm ERR! #mui/material#"^5.6.0" from the root project
npm ERR! peer #mui/material#"^5.2.8" from #mui/x-data-grid#5.8.0
npm ERR! node_modules/#mui/x-data-grid
npm ERR! #mui/x-data-grid#"*" from the root project
npm ERR! 4 more (#emotion/react, #emotion/styled, react-dom, #mui/system)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react#"^17.0.2" from #mui/x-data-grid#5.8.0
npm ERR! node_modules/#mui/x-data-grid
npm ERR! #mui/x-data-grid#"*" 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 C:\Users\01kar\AppData\Local\npm-cache\eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\01kar\AppData\Local\npm-cache\_logs\2022-04-06T12_50_46_543Z-debug-0.log
What I think is that there is some version mismatch in the dependencies.
New to react so can't understand the dependencies. Please give a step by step process to resolve this error.
{
"name": "highradius",
"version": "0.1.0",
"private": true,
"dependencies": {
"#emotion/react": "^11.9.0",
"#emotion/styled": "^11.8.1",
"#mui/base": "^5.0.0-alpha.75",
"#mui/material": "^5.6.0",
"#testing-library/jest-dom": "^5.16.3",
"#testing-library/react": "^12.1.4",
"#testing-library/user-event": "^13.5.0",
"react": "^18.0.0",
"react-dom": "^18.0.0",
"react-scripts": "5.0.0",
"web-vitals": "^2.1.4"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}
This is the package.json file.
I tried installing npm install #mui/material #emotion/react #emotion/styled and it was installed successfully now I am trying to install data grid but its showing me this error.
npm i #mui/x-data-grid --legacy-peer-deps
Installing using this solved the issue for me.
Based on #mui/x-data-grid's documentation, it looks like this snippet of code should fix this issue
"peerDependencies": {
"#mui/material": "^5.0.0",
"react": "^17.0.0"
},
add --legacy-peer-deps at the end of your npm command like below 👇
npm i #mui/x-data-grid --legacy-peer-deps
try npm install #mui/x-data-grid --legacy-peer-deps and it will work fine.

electron-builder error related to node-gyp

I'm having an error whenever I try building my app with Electron.
I didn't have this issue until last week or so, It was working fine before, it suddenly stopped working.
I didn't understand the issue so I reinstalled my OS and everything on the computer, but it didn't change anything. I found some messages on the terminal telling me to install python, then VSCode with C++ for desktop applications, I did, then the error changed and I don't see any way to fix it any further.
This is my package.json, im running 'npm run build':
{
"name": "reactron",
"version": "0.1.0",
"private": true,
"dependencies": {
"#szhsin/react-menu": "^1.8.0",
"brace": "^0.11.1",
"electron-is-dev": "^1.1.0",
"fs-extra": "^10.0.0",
"gpu.js": "^2.11.4",
"gsap": "^3.4.0",
"howler": "^2.1.3",
"jsoneditor": "^9.5.6",
"jsoneditor-react": "^3.1.1",
"node-sass": "^4.14.1",
"react-draggable": "^4.4.3",
"react-json-editor-ajrm": "^2.5.13",
"react-xarrows": "^1.5.2",
"vanilla-picker": "^2.11.2"
},
"main": "public/electron.js",
"homepage": "./",
"scripts": {
"react-start": "react-scripts start",
"react-build": "react-scripts build",
"react-test": "react-scripts test --env=jsdom",
"react-eject": "react-scripts eject",
"electron-build": "electron-builder",
"build-electron": "mkdir build/src && robocopy electron build/electron /S & robocopy src/shared build/src/shared /S",
"release": "npm run react-build && electron-builder --publish=always",
"build": "npm run react-build && npm run electron-build",
"start": "concurrently \"cross-env BROWSER=none npm run react-start\" \"wait-on http://localhost:3000 && electron .\""
},
"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"
]
},
"devDependencies": {
"#reduxjs/toolkit": "^1.3.6",
"#testing-library/jest-dom": "^4.2.4",
"#testing-library/react": "^9.5.0",
"#testing-library/user-event": "^7.2.1",
"concurrently": "^5.1.0",
"cross-env": "^7.0.2",
"electron": "^8.1.1",
"electron-builder": "^22.13.1",
"electron-packager": "^14.2.1",
"electron-react-devtools": "^0.5.3",
"react": "^16.13.0",
"react-dom": "^16.13.0",
"react-indiana-drag-scroll": "^1.8.0",
"react-redux": "^7.2.0",
"react-scripts": "^3.4.3",
"redux": "^4.0.5",
"wait-on": "^4.0.1"
},
"build": {
"asar": false
}
}
And this is the output:
> reactron#0.1.0 electron-build C:\Users\Toqu\Documents\_works\reactron
> electron-builder
• electron-builder version=22.13.1 os=10.0.19043
• loaded configuration file=package.json ("build" field)
• loaded parent configuration preset=react-cra
• description is missed in the package.json appPackageFile=C:\Users\Toqu\Documents\_works\reactron\package.json
• author is missed in the package.json appPackageFile=C:\Users\Toqu\Documents\_works\reactron\package.json
• writing effective config file=dist\builder-effective-config.yaml
• rebuilding native dependencies dependencies=gl#4.9.2, node-sass#4.14.1 platform=win32 arch=x64
• install prebuilt binary name=gl version=4.9.2 platform=win32 arch=x64 napi=
• build native dependency from sources name=gl
version=4.9.2
platform=win32
arch=x64
napi=
reason=prebuild-install failed with error (run with env DEBUG=electron-builder to get more information)
error=prebuild-install info begin Prebuild-install version
5.3.6
prebuild-install WARN install prebuilt binaries enforced with --force!
prebuild-install WARN install prebuilt binaries may be out of date!
prebuild-install info looking for cached prebuild # C:\Users\Toqu\AppData\Roaming\npm-cache\_prebuilds\370169-gl-v4.9.2-electron-v76-win32-x64.tar.gz
prebuild-install http request GET https://github.com/stackgl/headless-gl/releases/download/v4.9.2/gl-v4.9.2-electron-v76-win32-x64.tar.gz
prebuild-install http 404 https://github.com/stackgl/headless-gl/releases/download/v4.9.2/gl-v4.9.2-electron-v76-win32-x64.tar.gz
prebuild-install WARN install No prebuilt binaries found (target=8.5.5 runtime=electron arch=x64
libc= platform=win32)
⨯ cannot execute cause=exit status 1
out=
> gl#4.9.2 install C:\Users\Toqu\Documents\_works\reactron\node_modules\gl
> prebuild-install || node-gyp rebuild
C:\Users\Toqu\Documents\_works\reactron\node_modules\gl>if not defined npm_config_node_gyp (node
"C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
Building the projects in this solution one at a time. To enable parallel build, please add the "-m" switch.
Copying C:\Users\Toqu\Documents\_works\reactron\node_modules\gl/deps/windows/dll/x64/libEGL.dll to C:\Users\Toqu\Documents\_works\reactron\node_modules\gl\build\Release\libEGL.dll
1 file(s) copied.
Copying C:\Users\Toqu\Documents\_works\reactron\node_modules\gl/deps/windows/dll/x64/libGLESv2.dll to C:\Users\Toqu\Documents\_works\reactron\node_modules\gl\build\Release\libGLESv2.dll
1 file(s) copied.
Copying C:\Users\Toqu\Documents\_works\reactron\node_modules\gl/deps/windows/dll/x64/d3dcompiler_47.dll to C:\Users\Toqu\Documents\_works\reactron\node_modules\gl\build\Release\d3dcompiler_47.dll
1 file(s) copied.
bindings.cc
webgl.cc
procs.cc
win_delay_load_hook.cc
C:\Users\Toqu\.electron-gyp\8.5.5\include\node\v8.h(8923,39): warning C4996: 'v8::MicrotasksCompletedCallback': Use *WithData version. (compiling source file ..\src\native\procs.cc) [C:\Users\Toqu\Documents\_works\reactron\node_modules\gl\build\webgl.vcxproj]
C:\Users\Toqu\.electron-gyp\8.5.5\include\node\v8.h(8931,42): warning C4996: 'v8::MicrotasksCompletedCallback': Use *WithData version. (compiling source file ..\src\native\procs.cc) [C:\Users\Toqu\Documents\_works\reactron\node_modules\gl\build\webgl.vcxproj]
C:\Users\Toqu\.electron-gyp\8.5.5\include\node\v8.h(8923,39): warning C4996: 'v8::MicrotasksCompletedCallback': Use *WithData version. (compiling source file ..\src\native\bindings.cc) [C:\Users\Toqu\Documents\_works\reactron\node_modules\gl\build\webgl.vcxproj]
C:\Users\Toqu\.electron-gyp\8.5.5\include\node\v8.h(8931,42): warning C4996: 'v8::MicrotasksCompletedCallback': Use *WithData version. (compiling source file ..\src\native\bindings.cc) [C:\Users\Toqu\Documents\_works\reactron\node_modules\gl\build\webgl.vcxproj]
C:\Users\Toqu\.electron-gyp\8.5.5\include\node\v8.h(8923,39): warning C4996: 'v8::MicrotasksCompletedCallback': Use *WithData version. (compiling source file ..\src\native\webgl.cc) [C:\Users\Toqu\Documents\_works\reactron\node_modules\gl\build\webgl.vcxproj]
C:\Users\Toqu\.electron-gyp\8.5.5\include\node\v8.h(8931,42): warning C4996: 'v8::MicrotasksCompletedCallback': Use *WithData version. (compiling source file ..\src\native\webgl.cc) [C:\Users\Toqu\Documents\_works\reactron\node_modules\gl\build\webgl.vcxproj]
C:\Users\Toqu\Documents\_works\reactron\node_modules\gl\src\native\webgl.cc(466,37): warning C4312: 'reinterpret_cast': conversion from 'GLint' to 'GLvoid *' of greater size [C:\Users\Toqu\Documents\_works\reactron\node_modules\gl\build\webgl.vcxproj]
Creating library C:\Users\Toqu\Documents\_works\reactron\node_modules\gl\build\Release\webgl.lib and object C:\Users\Toqu\Documents\_works\reactron\node_modules\gl\build\Release\webgl.exp
webgl.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class std::shared_ptr<class v8::BackingStore> __cdecl v8::ArrayBuffer::GetBackingStore(void)" (__imp_?GetBackingStore#ArrayBuffer#v8##QEAA?AV?$shared_ptr#VBackingStore#v8###std##XZ) referenced in function "public:
__cdecl Nan::TypedArrayContents<char>::TypedArrayContents<char>(class v8::Local<class v8::Value>)" (??0?$TypedArrayContents#D#Nan##QEAA#V?$Local#VValue#v8###v8###Z) [C:\Users\Toqu\Documents\_works\reactron\node_modules\gl\build\webgl.vcxproj]
C:\Users\Toqu\Documents\_works\reactron\node_modules\gl\build\Release\webgl.node : fatal error LNK1120: 1 unresolved externals [C:\Users\Toqu\Documents\_works\reactron\node_modules\gl\build\webgl.vcxproj]
errorOut=prebuild-install WARN install No prebuilt binaries found (target=8.5.5 runtime=electron arch=x64 libc= platform=win32)
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\MSBuild.exe` failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:194:23)
gyp ERR! stack at ChildProcess.emit (events.js:400:28)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:282:12)
gyp ERR! System Windows_NT 10.0.19043
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\Toqu\Documents\_works\reactron\node_modules\gl
gyp ERR! node -v v14.18.1
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! gl#4.9.2 install: `prebuild-install || node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the gl#4.9.2 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! C:\Users\Toqu\AppData\Roaming\npm-cache\_logs\2021-10-27T14_22_32_528Z-debug.log
command='C:\Program Files\nodejs\node.exe' 'C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js' rebuild gl#4.9.2 node-sass#4.14.1
workingDir=
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! reactron#0.1.0 electron-build: `electron-builder`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the reactron#0.1.0 electron-build 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\Toqu\AppData\Roaming\npm-cache\_logs\2021-10-27T14_22_32_631Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! reactron#0.1.0 build: `npm run react-build && npm run electron-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the reactron#0.1.0 build 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\Toqu\AppData\Roaming\npm-cache\_logs\2021-10-27T14_22_32_666Z-debug.log
Does anyone know how to solve this?

React npm run build is getting failed every time

when I am trying to build my react app. npm run build command is failed every time. When I use npm start command everything works fine,but I can not build the app with the command.
here is my error:
PS G:\self learning\react js\resort-reactjs> npm run build
> resort#0.1.0 build G:\self learning\react js\resort-reactjs
> react-scripts build
Creating an optimized production build...
Failed to compile.
static/js/main.b4300d14.js from UglifyJs
SyntaxError: Unexpected token: operator (>) [./~/contentful/dist/contentful.node.js:3909,0]
npm ERR! Windows_NT 10.0.18362
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\USER\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "run" "build"
npm ERR! node v12.18.1
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! resort#0.1.0 build: `react-scripts build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the resort#0.1.0 build script 'react-scripts 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 resort package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! react-scripts build
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs resort
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls resort
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! G:\self learning\react js\resort-reactjs\npm-debug.log
in my package.json file everything is updated. my package.json file here. :
{
"name": "resort",
"version": "0.1.0",
"private": true,
"dependencies": {
"react": "^16.13.1",
"react-dom": "^16.13.1",
"react-icons": "^3.10.0",
"react-router-dom": "^5.2.0",
"react-scripts": "0.9.5",
"styled-components": "^5.1.1"
},
"devDependencies": {},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
}
}
The package.json file looks fine to me. I think it is a bug, or, at least, a poorly documented error. Try debug or just cleanup unwanted files that you dont need around the project and restart the build.

Angular starting errors in package.json

Shortform:
While using 'Angular' for the first time I run in an Error telling me that tsc hasn't been found (package.json at the end).
Detail:
I am new to Angular and while I started an example from a book with
npm start I run in an Error with my package.json file. tsc: not found Error
sh: 1: tsc: not found
npm ERR! blog-app#1.0.0 start: `tsc && npm run copy:html && concurrently "npm run tsc:w" "npm run html:watch" "live-server" `
npm ERR! Exit status 127
npm ERR!
npm ERR! Failed at the blog-app#1.0.0 start script.
npm ERR! This is most likely a problem with the blog-app package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! tsc && npm run copy:html && concurrently "npm run tsc:w" "npm run html:watch" "live-server"
npm ERR! You can get their info via:
npm ERR! npm owner ls blog-app
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 4.14.62-v7+
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "start"
npm ERR! cwd /home/pi/webpages/3914_Zusatzmaterialien/kickstart/hello-angular
npm ERR! node -v v8.11.1
npm ERR! npm -v 1.4.21
npm ERR! code ELIFECYCLE
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/pi/webpages/3914_Zusatzmaterialien/kickstart/hello-angular/npm-debug.log
npm ERR! not ok code 0
I was supposed to run npm install in the directory of that distribution causing the follow error:
(node:1635) [DEP0022] DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead.
npm WARN package.json blog-app#1.0.0 No README data
npm WARN deprecated typings#1.0.4: Typings is deprecated in favor of NPM #types -- see README for more information
npm ERR! Error: Method Not Allowed
npm ERR! at errorResponse (/usr/share/npm/lib/cache/add-named.js:260:10)
npm ERR! at /usr/share/npm/lib/cache/add-named.js:203:12
npm ERR! at saved (/usr/share/npm/node_modules/npm-registry-client/lib/get.js:167:7)
npm ERR! at FSReqWrap.oncomplete (fs.js:135:15)
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR! <http://github.com/npm/npm/issues>
npm ERR! System Linux 4.14.62-v7+
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install"
npm ERR! cwd /home/pi/webpages/angulartry
npm ERR! node -v v8.11.1
npm ERR! npm -v 1.4.21
npm ERR! code E405
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/pi/webpages/angulartry/npm-debug.log
npm ERR! not ok code 0
i removed it multiple times and reinstalled it with npm install -g typescript.
npm install && npm start causes the following error
(node:1814) [DEP0022] DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead.
npm WARN package.json blog-app#1.0.0 No README data
npm WARN deprecated typings#1.0.4: Typings is deprecated in favor of NPM #types -- see README for more information
npm ERR! Error: Method Not Allowed
npm ERR! at errorResponse (/usr/share/npm/lib/cache/add-named.js:260:10)
npm ERR! at /usr/share/npm/lib/cache/add-named.js:203:12
npm ERR! at saved (/usr/share/npm/node_modules/npm-registry-client/lib/get.js:167:7)
npm ERR! at FSReqWrap.oncomplete (fs.js:135:15)
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR! <http://github.com/npm/npm/issues>
npm ERR! System Linux 4.14.62-v7+
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install"
npm ERR! cwd /home/pi/webpages/3914_Zusatzmaterialien/kickstart/hello-angular
npm ERR! node -v v8.11.1
npm ERR! npm -v 1.4.21
npm ERR! code E405
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/pi/webpages/3914_Zusatzmaterialien/kickstart/hello-angular/npm-debug.log
npm ERR! not ok code 0
If I remove tsc && from line 11
"start": "tsc && npm run copy:html
&& concurrently \"npm run tsc:w\" \"npm run html:watch\"
\"live-server\" ", , I run in the following error sh: 1:
copyfiles: not found.
About the System:
The System is running on a Raspberry Pi with Raspbian using npm version npm: '1.4.21'.
My Typescript Version seems to be 2.2.1. If it matters, I control the System from a Putty.
The package.json file:
{
"name": "blog-app",
"version": "1.0.0",
"description": "Blog Applikation",
"watch": {
"copy:html": "./app/**/*.html"
},
"scripts": {
"tsc": "./node_modules/.bin/tsc",
"tsc:w": "./node_modules/.bin/tsc --watch",
"start": "tsc && npm run copy:html && concurrently \"npm run tsc:w\" \"npm run html:watch\" \"live-server\" ",
"html:watch": "onchange \"./app/**/*.html\" -v -- npm run copy:html",
"copy:html": "copyfiles -u 1 ./app/**/*.html dist"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"#angular/common": ">=4.0.0-beta <5.0.0",
"#angular/compiler": ">=4.0.0-beta <5.0.0",
"#angular/core": ">=4.0.0-beta <5.0.0",
"#angular/forms": ">=4.0.0-beta <5.0.0",
"#angular/http": ">=4.0.0-beta <5.0.0",
"#angular/platform-browser": ">=4.0.0-beta <5.0.0",
"#angular/platform-browser-dynamic": ">=4.0.0-beta <5.0.0",
"systemjs": "0.19.27",
"core-js": "2.4.1",
"reflect-metadata": "0.1.3",
"rxjs": "5.1.0",
"zone.js": "0.8.4",
"bootstrap": "3.3.6"
},
"devDependencies": {
"canonical-path": "0.0.2",
"concurrently": "2.2.0",
"copyfiles": "1.0.0",
"http-server": "0.9.0",
"live-server": "1.1.0",
"lodash": "4.11.1",
"npm-watch": "0.1.6",
"onchange": "3.0.2",
"rimraf": "2.5.2",
"tslint": "3.7.4",
"typescript": "2.2.0",
"typings": "1.0.4"
},
"repository": {}
}
It looks like the typescript did not be installed successfully. You can try :
npm install -g typescript
And then
npm install && npm start
My advice is to generate project using angular cli and check its package.json file, it looks a bit different than yours

Categories

Resources