Getting errors on creating new project using command 'ng new <project_name>' after upgrading to version 9 - angular9

Please find the stack over here...
Installing packages...npm WARN deprecated tslint#6.1.2: TSLint has been deprecated in favor of ESLint. Please see https://github.com/palantir/tslint/issues/4534 for more information.
npm WARN deprecated request#2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated chokidar#2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated fsevents#1.2.12: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm WARN deprecated urix#0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated resolve-url#0.2.1: https://github.com/lydell/resolve-url#deprecated
npm ERR! Unexpected end of JSON input while parsing near '...iERRHPyU8nBqZB1+iv2Uh'

I had the exact same error and was able to fix it through following steps.
Run npm cache clean --force
Manually delete npm and npm-cache folders from AppData/Roaming folder (Win + R, Type %AppData% and enter)
Run Node Installer and repair
Reinstall npm install -g #angular/cli
Rerun ng new newApp
Worked :)
Use node V12.4.0 and npm V6.9.0

i was getting the same issue please try reinstall angular CLI after installing previous one

I think this can only be achieved if we first update the version to 8 and then move from 8 to 9.

I had the same Issue and Following steps worked for me.
Delete npm-cache in AppData/Roaming
Reinstall the angular cli by 'npm install -g #angular/cli'
Then Create the project

Run npm cache clean --force
Manually delete npm and npm-cache folders from AppData/Roaming folder (Win + R, Type %AppData% and enter)
Run Node Installer and repair
4.Reinstall npm install -g #angular/cli
Rerun ng new newApp
Worked :)
https://github.com/npm/cli/issues/1191

Delete the AppData\Roaming\npm-cache folder and then try creating the project again. This is really gonna work =)

Related

Can't seem to win installing gulp globally on my Windows 10 machine

I keep getting this message when trying to install gulp globally, i have tried a lot of the solutions and nothing seem to work for me.
$ npm install --global gulp-cli
npm WARN deprecated resolve-url#0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated urix#0.1.0: Please see https://github.com/lydell/urix#deprecated
C:\Users\Jerry\AppData\Roaming\npm\gulp -> C:\Users\Jerry\AppData\Roaming\npm\node_modules\gulp-cli\bin\gulp.js
gulp-cli#2.3.0
added 235 packages from 163 contributors and updated 1 package in 40.499s

npm start not working for react while install react script (react script : 3.4.0 version)

I am new to React js, While using npm start after install the react not working,I tried every process but no use. Thanks in advance
Error
cricdost#0.1.0 start C:\xampp\htdocs\cd-web
react-scripts start
There might be a problem with the project dependency tree.
It is likely not a bug in Create React App, but something you need to fix locally.
The react-scripts package provided by Create React App requires a dependency:
"webpack": "4.41.2"
Don't try to install it manually: your package manager does it automatically.
However, a different version of webpack was detected higher up in the tree:
C:\xampp\htdocs\node_modules\webpack (version: 4.39.2)
Manually installing incompatible versions is known to cause hard-to-debug issues.
If you would prefer to ignore this check, add SKIP_PREFLIGHT_CHECK=true to an .env file in your project.
That will permanently disable this message but you might encounter other issues.
To fix the dependency tree, try following the steps below in the exact order:
Delete package-lock.json (not package.json!) and/or yarn.lock in your project folder.
Delete node_modules in your project folder.
Remove "webpack" from dependencies and/or devDependencies in the package.json file in your project folder.
Run npm install or yarn, depending on the package manager you use.
In most cases, this should be enough to fix the problem.
If this has not helped, there are a few other things you can try:
If you used npm, install yarn (http://yarnpkg.com/) and repeat the above steps with it instead.
This may help because npm has known issues with package hoisting which may get resolved in future versions.
Check if C:\xampp\htdocs\node_modules\webpack is outside your project directory.
For example, you might have accidentally installed something in your home folder.
Try running npm ls webpack in your project folder.
This will tell you which other package (apart from the expected react-scripts) installed webpack.
If nothing else helps, add SKIP_PREFLIGHT_CHECK=true to an .env file in your project.
That would permanently disable this preflight check in case you want to proceed anyway.
P.S. We know this message is long but please read the steps above :-) We hope you find them helpful!
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! cricdost#0.1.0 start: react-scripts start
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the cricdost#0.1.0 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\XSC-10261\AppData\Roaming\npm-cache_logs\2020-02-20T04_56_31_650Z-debug.log
I had faced the same error. The solution that I found is to do the step-6 as described in Error message. That is to delete "webpack" folder of node_module folder under your root projects directory. For example
Assume that you installed "npm install create-react-app" in D:\Projects folder.
And then you ran "npx create-react-app firstproject" in D:\Projects folder. So, your actual react project folder is "D:\Projects\firstproject".
So, what I want to tell is don't delete "webpack" folder in "D:\Projects\firstproject\node_module" directory. Instead, delete "webpack" folder in "D:\Projects\node_module" directory.
And then, you can run "npm start" command in your actual react project directory "D:\Projects\firstproject".
I hope, this will work for you.

#polymer/lit-element has been deprecated

I am using #polymer/lit-element for my application.Recently I did npm install
which led to following error
"npm WARN deprecated #polymer/lit-element#0.5.2: #polymer/lit-element has moved to lit-element. Please uninstall this package and install lit-element. See https://www.polymer-project.org/blog/2019-01-11-lit-element-rc".
When I checked my node_modules, the lit-element folder had been deleted from #polymer folder.Is there any way that I can get back my #polymer/lit-element?
( Apart from the point that I have to migrate whole my application to lit-element which sounds tedious )
npm WARN deprecated #polymer/lit-element#0.5.2 is a warning not an error. v0.5.2 is still available for use. You can npm install to install the dependencies listed in your package.json or if #polymer/lit-element is not listed in in package.json you can add it with npm install --save #polymer/lit-element#0.5.1.
That being said #polymer/lit-element is deprecated and being replaced with lit-element. You should replace #polymer/lit-element with lit-element within package.json and your codebase.

gulp - internalBinding is not defined

I'm getting this error when I try to run the command gulp watch-bs for my UnderStrap child theme for WordPress. I've been using this command for a year with no problems, but I received this error today when I updated my node and npm to their latest versions.
ReferenceError: internalBinding is not defined
at internal/util/inspect.js:31:15
at req_ (C:\xampp\htdocs\node_modules\natives\index.js:137:5)
at require (C:\xampp\htdocs\node_modules\natives\index.js:110:12)
at util.js:25:21
at req_ (C:\xampp\htdocs\node_modules\natives\index.js:137:5)
at require (C:\xampp\htdocs\node_modules\natives\index.js:110:12)
at fs.js:42:21
at req_ (C:\xampp\htdocs\node_modules\natives\index.js:137:5)
at Object.req [as require] (C:\xampp\htdocs\node_modules\natives\index.js:54:10)
at Object.<anonymous> (C:\xampp\htdocs\node_modules\vinyl-fs\node_modules\graceful-fs\fs.js:1:99)
I've read here that, in order to resolve the issue, I need to run this command:
npm install natives#1.1.6
but this did not help resolve the issue.
Am I missing something else?
I ran into the same issue as you. To fix it, I added the following to my package.json in the devDependencies section
"natives": "^1.1.6"
I had the same error after upgrading node to v10.16.0
I ran the following which solved my issue:
rm -rf node_modules
rm package-lock.json
npm cache clean --force
npm install
After closer inspection, it would seem that the generated tree in package-lock was outdated.
I also faced the same problem and then I fixed by the following command:
npm install natives#1.1.6
May be helpful if someone having same issue.
updating node to latest version requires above package.
I recently ran into the same problem after installing node. Similar to #Dv-Learner answer, What fixed it for me was:
npm install natives#1.1.6
npm rebuild node-sass
the bit about rebuild node-sass was required for my machine (Windows)
#Student 22, in addition to Lloyd's solution, I simply updated my version to the most recent version for gulp using the command below ( Local Version 3.9.1 to Local Version 4.0.0) and I didn't run any additional commands.
npm install gulp-update
Reference: https://github.com/nodejs/node/issues/24985
Good luck!
In my case, I downgraded my node version from 10.16.0 to 8.11.4 which was required by my current project by this command
sudo n 8.11.4
Had the same error. Solved it by installing graceful-fs.
It seems that natives package is now deprecatd and you should install graceful-fs instead.
I had node v10.16.1 and glup local version 3.9.1. I ran 'npm install graceful-fs' and glup no longer gave the error in this question.
(Can't comment yet, so an answer).
Try this, it's working for me:
npm install -g graceful-fs graceful-fs#latest

Electron cannot find module mysql

So i've been creating a desktop application using electron. The problem is that when I run my application using npm it doesn't show any error about a missing module but when i package it and run it this error shows
I'm sure that i've install mysql module using npm install -g mysql and npm install mysql in the project directory. It's all working fine when i run the unpacked version of the application
Assuming that you have installed mysql if not please install mysql npm install mysql --save-dev
Hi I also ran in same error I tried everything possible but nothing seems to work , after several hit and trial I was able to fix it and in the end realize that it was all happening because of
When I installed MySQL module I never saved it (--save-dev)
And electron-packager was not able to locate it when I pack it because was not mention in package.json
A solution might locate mysql folder in node_module folder and delete
then install it npm install mysql --save-dev
or manually
add it under dependencies in package.json file