Angular 2 polyfills trouble - javascript

So I had a hard drive failure and lost everything but of course github to the rescue. I recently finished my first Angular 2 project and did a git clone to recover it and every time I try to run ng server I get this error...
ERROR in ./src/main.ts
Module build failed: TypeError: Cannot read property 'newLine' of undefined
at Object.getNewLineCharacter (D:\GitHub\sandbox\meadowbrook_acres\angular-src\node_modules\typescript\lib\typescript.js:8062:20)
at Object.createCompilerHost (D:\GitHub\sandbox\meadowbrook_acres\angular-src\node_modules\typescript\lib\typescript.js:44978:26)
at Object.ngcLoader (D:\GitHub\sandbox\meadowbrook_acres\angular-src\node_modules\#ngtools\webpack\src\loader.js:338:33)
# multi webpack-dev-server/client?http://localhost:4200 ./src/main.ts
ERROR in ./src/polyfills.ts
Module build failed: TypeError: Cannot read property 'newLine' of undefined
at Object.getNewLineCharacter (D:\GitHub\sandbox\meadowbrook_acres\angular-src\node_modules\typescript\lib\typescript.js:8062:20)
at Object.createCompilerHost (D:\GitHub\sandbox\meadowbrook_acres\angular-src\node_modules\typescript\lib\typescript.js:44978:26)
at Object.ngcLoader (D:\GitHub\sandbox\meadowbrook_acres\angular-src\node_modules\#ngtools\webpack\src\loader.js:338:33)
# multi ./src/polyfills.ts`
I did an npm install on both the project folder and the angular src folder then did a npm install typings --global after googling this error and still it doesn't allow me to do anything. any other ideas on what I can do?

Related

How to solve this - Could not resolve "app/javascript/*.*" issue in Rails

I am currently working on a full-stack application where I need to use React for the Front-end and Rails for Back-end. I am using Esbuild which gives me access to make use of jsx in rails. However, I am having a series of issues with it as shown below. Please, how do I resolve this [ERROR] Could not resolve "app/javascript/*.*"
Could it be that it's not compatible with my system because I am seeing so many incompatibility issues in the log.
Done in 65.24s.
Add build script
run npm set-script build "esbuild app/javascript/*.* --bundle --sourcemap --outdir=app/assets/builds --public-path=assets" from "."
npm WARN set-script set-script is deprecated, use `npm pkg set scripts.scriptname="cmd" instead.
run yarn build from "."
yarn run v1.22.15
warning ..\package.json: No license field
$ esbuild app/javascript/*.* --bundle --sourcemap --outdir=app/assets/builds --public-path=assets
X [ERROR] Could not resolve "app/javascript/*.*"
It looks like you are trying to use glob syntax (i.e. "*") with esbuild. This syntax is
typically handled by your shell, and isn't handled by esbuild itself. You must expand glob
syntax first before passing your paths to esbuild.
1 error
node:child_process:879
throw err;
^
Error: Command failed: C:\Users\Dennis\hello-rails-react\node_modules\esbuild-windows-64\esbuild.exe app/javascript/*.* --bundle --sourcemap --outdir=app/assets/builds --public-path=assets
I had the same error while building my rails application.
In the package.json file. In the scripts section, Instead of a general path
app/javascript/*.*
I specified the exact file name
app/javascript/application.js
and my problem was solved.

d3js/Angular 8 application issue

I am trying to construct a tube-map with the help of d3js and Angular. I am using Angular 8 and d3 version 3.4.13. On doing npm start I'm getting a series of errors. Any leads on figuring out why that may be happening would be of great help.
Here is a link to the repository:
https://github.com/reshnaz/Tubemap.git
I'm getting the below errors:
ERROR in ./node_modules/xmlhttprequest/lib/XMLHttpRequest.js
Module not found: Error: Can't resolve 'child_process' in '/home/reshma/Documents/Angular/tubemap_project/tubemap-dashboard/node_modules/xmlhttprequest/lib'
ERROR in ./node_modules/jsdom/lib/jsdom/browser/index.js
Module not found: Error: Can't resolve 'cssstyle' in
'/home/reshma/Documents/Angular/tubemap_project/tubemap-dashboard/node_modules/jsdom/lib/jsdom/browser'
ERROR in ./node_modules/jsdom/lib/jsdom/level2/style.js
Module not found: Error: Can't resolve 'cssstyle' in
'/home/reshma/Documents/Angular/tubemap_project/tubemap-dashboard/node_modules/jsdom/lib/jsdom/level2'
ERROR in ./node_modules/jsdom/lib/jsdom.js
Module not found: Error: Can't resolve 'fs' in
'/home/reshma/Documents/Angular/tubemap_project/tubemap-dashboard/node_modules/jsdom/lib'
ERROR in ./node_modules/jsdom/lib/jsdom/level2/html.js
Module not found: Error: Can't resolve 'fs' in
'/home/reshma/Documents/Angular/tubemap_project/tubemap-dashboard/node_modules/jsdom/lib/jsdom/level2'
ERROR in ./node_modules/xmlhttprequest/lib/XMLHttpRequest.js
Module not found: Error: Can't resolve 'fs' in
'/home/reshma/Documents/Angular/tubemap_project/tubemap-dashboard/node_modules/xmlhttprequest/lib'
ERROR in ./node_modules/jsdom/lib/jsdom.js
Module not found: Error: Can't resolve 'request' in
'/home/reshma/Documents/Angular/tubemap_project/tubemap-dashboard/node_modules/jsdom/lib'
I cannot believe the problem is caused by anything other than the old version of d3 you are using.
The errors you are seeing about missing modules are likely to be because you ran npm install and this generated a load of errors which you either failed to notice or deliberately ignored, and tried to proceed anyway as if nothing was wrong. Or maybe npm install ran fine but your node_modules folder contains a load of cruft left over from the React.js project? What happens if you delete your node_modules folder and try running npm install again?
How the original React.js app you mention worked I can't say, especially since you don't provide a link to the GitHub source code you mention. Perhaps it used an older version of React, which in turn required other older dependencies. Deciding to use the latest version of Angular is somewhat at odds with deciding to use such an old version of d3 in the same project.
The only suggestion I have (if it isn't already obvious) is to bite the bullet and upgrade your project to the latest version of d3. Yes, you will have to change the way your code calls to d3, as d3 has changed somewhat between version 3 and version 5. But that's just too bad.
Deleting node_modules and package-lock.json, followed by npm cache clean and npm install solved the problem.

error in building a nodejs application

I'm trying to get this github project to work. These are the steps I followed
cloned it using git clone <url>
Execute npm install inside the new directory
Execute npm run build
Finally start the server with npm start
But step 3 gives errors regarding missing files and directories. Is there any step I'm missing?
If possible can anyone run it and confirm the error?
ERROR in ./src/index.js
Module not found: Error: Cannot resolve 'file' or 'directory' ./components/App in /home/terry/dethread-demo-applications/src
# ./src/index.js 11:11-38

ReactJS, react-validation issue during build

Im trying to use net core template for react, and for validation purposes I've added react-validation package but it throws an error while starting app:
ERROR in ./~/react-validation/lib/build/validation.js
Module not found: Error: Can't resolve 'classnames' in 'C:\Users\pk\Documents\visual studio 2017\Projects\BetHub\BetHub.UI\node_modules\react-validation\lib\build'
# ./~/react-validation/lib/build/validation.js 3:45-66
# ./ClientApp/boot.tsx
# multi react-hot-loader/patch event-source-polyfill webpack-hot-middleware/client?path=__webpack_hmr&dynamicPublicPath=true ./ClientApp/boot.tsx
It seems as if it was not installed, but I've checked in node_modules an the package is there, anything Im missing?
Thanks for help!
This is actually a problem you should be asking on the npm package's open issues on github. I did a small amount of digging, and it turns out a few other people had the same problem. Their fix: Install classnames
npm install classnames --save

Unable to build meteor app (Windows): \promise_server.js:116

More code posted here https://forums.meteor.com/t/major-node-issue-unable-to-build-meteor-app-windows-promise-server-js-116/26798/1
I get the following errors when I try to build or update an app:
When UPDATEing from 1.2.1 to any other version:
C:\Users\user1\AppData\Local\.meteor\packages\less\2.6.0\plugin.compileLessBatch.os\npm\node_modules\meteor\promise\node_modules\meteor-promise\promise_server.js:116
throw error;
^
Error: ENOTDIR, readdir '<projectDirectory>\.meteor\local\isopacks\.build994576.ccbanker_template-banker\web.browser\client\js\settings\.builder-tmp-file.264146'
When BUILDing an app - which is meteor 1.3.5.1
C:\Users\user2\AppData\Local\.meteor\packages\templating\1.1.9\plugin.compileTemplatesBatch.os\npm\node_modules\meteor\promise\node_modules\meteor-promise\promise_server.js:116
throw error;
^
TypeError: Cannot call method 'split' of undefined
I also get a similar error when I create a new empty app, and then try to BUILD it (which succeeds) and NPM INSTALL (which fails, again throwing the error at promise_server.js:116)
Have tried rebuilding all of this on a clean install of node+npm+meteor.
Node version 0.10.40 require for npm build in meteor js.
You can use nvm for node version change: https://github.com/creationix/nvm

Categories

Resources