Issue with Running Angular 7 Projects - javascript

After installation of Node.js (10.x & 11.X) versions while running the angular projects (ng serve -0) I get the following error message.
ERROR in ./src/styles.scss
(./node_modules/#angular-devkit/build-angular/src/ang
ular-cli-files/plugins/raw-css-loader.js!./node_modules/postcss-loader/src??embe
dded!./node_modules/sass-loader/lib/loader.js??ref--14-3!./src/styles.scss)
Module build failed (from ./node_modules/sass-loader/lib/loader.js):
Error: Cannot find module 'node-sass'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:582:15)
at Function.Module._load (internal/modules/cjs/loader.js:508:25)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:22:18)
at Object.sassLoader (E:\Projects\my-app\node_modules\sass-loader\lib\loader .js:46:72) i
?wdm?: Failed to compile.
I have gone through a lot of stack overflow questions and angular forum but none of the solutions provided are working for me.
I have tried the following commands :
npm install --save-dev --unsafe-perm node-sass
npm rebuild node-sass --force
npm install --save-dev #angular-devkit/build-angular
ng update #angular/cli
I also tried updating the npm as well with the command : npm install -g npm#latest
I have gone through the question : ERROR in Cannot find module 'node-sass'
But none of the code helps. I tried reinstalling node with different versions but still the same error is being thrown.
Screenshot : https://imgur.com/a/1iKNcw0
Edit 1
Please take a look at this github thread
I tried changing the sass in the angular.json file as mentioned in the thread but still the issue persists.
Edit 2
I have updated the images in the imagur link The first image shows a response from CLI after successful creation of an angular project. The rest of the four images display the console details of the system having issue in running Angular 7.
I am also adding the pastebin for the aforementioned :
Without Issue
System with Issue
Edit 3
The Angular version details is provided below

Related

npm warn and npm start issues

I recently started coding again and I've got some issues regarding React/NodeJS (don't know which one is responsible for that)
So first things first, I installed VSCode, all clean, no errors no nothing. Then I installed NodeJS.
Now I'm just trying to create a React project for my own. I didn't install React at all as it seems it came by default after installing NodeJS. Now comes the ugly stuff.
Whenever I use the "npx create-react-app something-name" I get the following:
$ npx create-react-app demo
npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.
I also get some audit errors/vulnerabilities but maybe they are not so important as they get fixed after I use "audit fix --force".
So let's say that we just want to start the project.
I use cd something-name and npm start and I get this:
$ npm start
> demo#0.1.0 start
> react-scripts start
The system cannot find the path specified.
node:internal/modules/cjs/loader:936
throw err;
^
Error: Cannot find module 'D:\react-scripts\bin\react-scripts.js'
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
at Function.Module._load (node:internal/modules/cjs/loader:778:27)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
at node:internal/main/run_main_module:17:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
If anybody could help me remove those warnings from NPM and also let me know what should I do in order to start my project would be highly appreciated!
Hello there sir here are some possible fixes according to a previous question
Error: Cannot find module '\react-scripts\bin\react-scripts.js'
Check your package.json file in your project folder
delete node_modules, and package.lock.json reinstall them by
npm install
Check if your project path has a special character which is "&" just remove it
Try running a production build
//makes the production build
npm build
// runs the production build
npm run build
Finally try reinstalling node js on your system that could be the issue aswell
https://nodejs.org/en/
check your node version and make sure is updated.
remove the node-modules ()
npm install
npm start

Expo commands throwing "Error: Cannot find module 'minizlib'"

Whenever I try to run such commands as expo init or expo start or even just expo, it responds with:
Error: Cannot find module 'minizlib'
Require stack:
- /usr/local/lib/node_modules/expo-cli/node_modules/tar/lib/pack.js
- /usr/local/lib/node_modules/expo-cli/node_modules/tar/lib/create.js
- /usr/local/lib/node_modules/expo-cli/node_modules/tar/index.js
- /usr/local/lib/node_modules/expo-cli/node_modules/#expo/xdl/build/Extract.js
- /usr/local/lib/node_modules/expo-cli/node_modules/#expo/xdl/build/Api.js
- /usr/local/lib/node_modules/expo-cli/node_modules/#expo/xdl/build/xdl.js
- /usr/local/lib/node_modules/expo-cli/build/exp.js
- /usr/local/lib/node_modules/expo-cli/bin/expo.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:625:15)
at Function.Module._load (internal/modules/cjs/loader.js:527:27)
at Module.require (internal/modules/cjs/loader.js:683:19)
at require (internal/modules/cjs/helpers.js:16:16)
at Object.<anonymous> (/usr/local/lib/node_modules/expo-cli/node_modules/tar/lib/pack.js:28:14)
at Module._compile (internal/modules/cjs/loader.js:776:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
at Module.load (internal/modules/cjs/loader.js:643:32)
at Function.Module._load (internal/modules/cjs/loader.js:556:12)
at Module.require (internal/modules/cjs/loader.js:683:19)
I have tried install and reinstalling minizlib, along with expo, expo-cli, npm, and node and nothing has worked.
Any help would be appreciated.
OS: Ubuntu 18.04.2
I had the same issue. I downgraded to version 10 of node using nvm install 10 (If you do not have NVM look into it here it is very useful) then reinstalled the expo-cli with npm install -g expo-cli. This ended up solving the issue for me.
Note: This downgrade is temporary if you want to make it your default version you have to run nvm alias default 10
I had the same issue with "minizlib" not being found. None of the solutions posted on here or other threads regarding this issue solved it.
But, I figured it out. And here is what worked for me. Its pretty straight forward.
All the modules necessary for Expo to run should be located at
/usr/local/lib/node_modules/expo-cli/node_modules/
So, go to your home directory and run npm install minizlib#2.1.0.
This will put the module file in the home directory. (I say home
directory so that the npm install doesnt clutter files into whichever
directory you were previously working on)
Now, you need to copy+paste the module folder to whichever folder npm
is looking for while running the expo command. In your case its
/usr/local/lib/node_modules/expo-cli/node_modules/
This solved the problem for me. If it worked for anyone else, please validate it for me.
install the library
npm install -g minizlib
I had the same issue and I found the way to solve it in an external forum. thanks to #parkerroanm answer there.
Anyway, here is how I solved it (from the answer I found):
I uninstalled expo-cli with this command: sudo npm uninstall -g expo-cli This is did not actually uninstall expo and nothing I could do would. So i deleted the folder with this command: sudo rm -r /usr/local/lib/node_modules/expo-cli
Then reinstalled using yarn instead with: yarn global add expo-cli --save
I updated the PATH in .bashrc to include export PATH="$(yarn global bin):$PATH" to the bottom of the file.
This fixed the issue for me.
It seems to all stem from a permissions error on installation for the
sharp library.

npm ERR! code EPERM and errno -4048 on windows 10

I'm writing code using WebStorm. Today I tryed to install redux-form and from that moment the code it's broken. Also if the yarn install goes well I i get this error into browser on localhost
C:/Users/WebstormProjects/.....reducer.ts
(7,40): Could not find a declaration file for module 'redux-form'. 'C:/Users/WebstormProjects.....index.js' implicitly has an 'any' type.
Try `npm install #types/redux-form` if it exists or add a new declaration (.d.ts) file containing `declare module 'redux-form';`
The code have no semantic error and I also installed as the error says npm install #types/redux-form but the situation it's the same. Can someone help me??
(Posted on behalf of the question author).
I solved the problem deleting the directory with node modules and do: npm install, installing the redux-form and later installing types for this component.

Error when starting Node Application - MEAN Stack

I have started to create a Node js application using MEAN Stack so i have followed the steps in the following URL to intialize a node js Application using MEAN.
Link
When i provide GRUNT or Started the Node js Application in Terminal, I am getting the following error.
events.js:72
throw er; // Unhandled 'error' event
^
Error: ENOENT, open '/home/vigneshmoha/Documents/node/branding/public/system/lib/bootstrap/dist/css/bootstrap.css'
[nodemon] app crashed - waiting for file changes before starting...
npm version 1.4.15
Node js version v0.10.28
MongoDB version v2.6.1
I haven't changed anything else. Am i missing anything?
I am not sure about this but try installing bower with the command..
npm install -g bower
and then sudo bower install --allow -root
Now check if the files are created
try this
npm cache clean
npm install
I just had the exact same problem (on Mac OS X 10.9). Running npm install without sudo fixed it. Seems like bower is causing some troubles when used with sudo.
This error might be also due to errors in your Nodejs application. Fix the errors. You might also need to install bower:
npm install -g bower . tested on windows 10 and it worked.
Had the same issue., tried to delete node_modules, did npm install., but the scenario remained same.
On restarting the system, it seems to be back to normal.

grunt Cannot find module 'coffee-script'

I used the following commands to install a mean stack and create an app:
> sudo npm install -g meanio#latest // Get the mean cmdline
> mean init myApp // create your first app
> cd myApp && npm install // Install dependencies
> grunt // Launch mean
but when I get to the final grunt command I get the error:
module.js:333
throw err;
^ Error: Cannot find module 'coffee-script'
at Function.Module._resolveFilename (module.js:331:15)
at Function.Module._load (module.js:273:25)
at Module.require (module.js:357:17)
at require (module.js:373:17)
at Object.<anonymous> (/home/eddie/ResFour/node_modules/grunt/lib/grunt.js:16:1)
I've tried various solutions on stackoverflow to no avail:
NodeJS - setting up mean.io cannot find module errors
Cannot find module 'coffee-script'
I also cleared npm cache and reinstalled a few times.
Remove node_modules directory.
npm cache clean to empty downloaded temporary dependencies, just in case.
npm install again, and better not to interrupt it while running.
These solved most of these problems for me.
This worked for me:
npm install --save-dev coffee-script
node -v # v0.10.31
I had the same problem, and in the end of the log I was receiving such a message:
...
http 200 http://registry.npmjs.org/-/all
Killed
The problem was the lack of enough memory in my VM. One solution was to use swap is mentioned here.

Categories