Uncaught ReferenceError: req is not defined with cli#1.5 - javascript

Found this post that appears to resolve the issues.
https://github.com/angular/angular-cli/issues/8359
Sorry but it is not clear to me what is the next step to fix this issue?
Which version of angular cli should I upgrade to fix this?
Note that this happens in compiling in angular production mode.

This should do the trick:
npm uninstall -g angular-cli
npm cache clean
npm install -g angular-cli#1.4.9
People in the post generally mention no issues after going to CLI 1.4.9
Also, the Angular verison might need to be dropped down as well if just doing the CLI doesn't work. See jonathanbruno's comment on that page

Related

Vue-cli in [eslint] Cannot read properties of undefined (reading 'type') error

I installed Vue cli. I'm running the npm run serve command without writing any code yet, but unfortunately I'm getting below error. Is there anyone who can help?
The latest version of Node Js is installed. I thought it had something to do with Nodejs so I reinstalled nodejs but it didn't work.
I encountered the same issue today. Apparently it is caused by the newest version of esquery (1.4.1).
To fix this simply use an older version of esquery. You can do this via:
npm install --save-dev esquery#1.4.0
Be sure to not update or remove the ^ from "esquery": "^1.4.0" in package.json afterwards.
It's an esquery bug. Here is the relevant issue: https://github.com/estools/esquery/issues/135
If you are using yarn you can resolve a previous version of the problematic package (esquery) by putting this into packge.json. This will ignore the problematic version from one of the deps and use this explicit version.
"resolutions": {
"esquery": "1.4.0"
},
If you are using npm you can replace resolutions with overrides: https://docs.npmjs.com/cli/v8/configuring-npm/package-json#overrides
How resolution works: https://classic.yarnpkg.com/lang/en/docs/selective-version-resolutions/#toc-how-to-use-it
Thank you for your answers. After I asked my question here, I reinstalled the vue cli project, but this time I did it by installing the default settings. I had installed it using airnb settings in the previous installation. This is how I solved the problem.

Problem using command "ng new my-app" with updated #angular/cli

npm version 7.5.4 detected. The Angular CLI temporarily requires npm version 6 while upstream issues are addressed.
Please install a compatible version to proceed (npm install --global npm#6).
For additional information and alternative workarounds, please see https://github.com/angular/angular-cli/issues/19957#issuecomment-775407654
Update
The issue is closed and the problem solved
NPM 7.5.6 or greater.
Angular CLI 9.1.15, 10.2.3, 11.2.2, 12.0.0-next.2 or greater (within each major version).
if you still having problems use:
Hi you can bypass the error using ng new --skip-install <-- Workaround
Unfortunately is not the best approach is downgrade node and npm , stay tune here is the open issue :https://github.com/angular/angular-cli/issues/19957
If you want to use schematics the workaround will doesn't work ,please downgrade

Error installing npm package 'kurento-client' (BufferUtil ~ node-gyp rebuild)

I'm trying to install a package 'Kurento-client' via npm but it gives error in installing its own dependencies (bufferutil and utf-8-validate). Error also mentions 'node-gyp rebuild'
Here is the screenshot of the error:
Can you please tell, what should I do or change?
When I install those 2 dependencies separately (bufferuil and utf-8-validate), they install successfully with the latest version.
But the Kurento-client is installing their old version. I don't know why. I need only kurento-client to be installed.
After searching for a while, I solved it by dropping the npm version. The reason is that some packages have dependencies which they need to install, and in our case, those dependencies were of the old version which cannot correlate with the newer version of npm. Either you have to update those ones separately or drop your npm version. Hope it helps someone!

Angular project creation failed because of deprecated circular-json

I used following command to create new angular project
ng new hello-world
It failed showing
npm WARN deprecated circular-json#0.5.9: CircularJSON is in maintenance only, flatted is its successor.
npm ERR! Unexpected end of JSON input while parsing near '...rocess":"~0.7.0"},"_h'
Then I installed flatted using...
npm i flatted
But the error still occurs.
How to use flatted instead of deprecated library circular-json?
Run following commands that will clean NPM cache
npm cache clean --force
after this run following command
npm install -g #angular/cli#latest
then you can create angular project.
If it doesn't work, even after clearing the cache, which happened in my case:
Make sure you try the ng new create-app command using Powershell in administrator mode.
This worked for me.
I had the same problem. None of the above mentioned answers worked for me.
So I removed the content of .npmrc, ran the generate command and it worked.
After that, you can restore the content of your .npmrc if needed.

Warning with installing fetch to node js

When i'm installing node-fetch
Here's a link
I'm getting that warning
`-- node-fetch#1.6.3
npm WARN motivation_bot#1.0.0 No repository field.
How to resolve the problem?
npm often gives warning while installing packages. In 99%, these are mistakes made by the creator of the package, in your cause motivation_bot. You can ignore them all if your package works like it should do. You will get warnings nearly every installation so don't care about it ^^.
Follow the instructions and install the package using the correct syntax (npm install node-fetch --save). After that, check your dependencies in the package.json file. If you find the package "node-fetch", you don't need to worry about the warning message.

Categories

Resources