I have downloaded an angular project from angular.io tutorial when i run this project
it shows error
Could not find module "#angular-devkit/build-angular" from "C:\Users\asus\angulario".
Error: Could not find module "#angular-devkit/build-angular" from "C:\Users\asus\angulario"
Could not find module "#angular-devkit/build-angular" from "C:\\Users\\asus\\angulario".
Error: Could not find module "#angular-devkit/build-angular" from "C:\\Users\\asus\\angulario".
at Object.resolve (C:\Users\asus\AppData\Roaming\npm\node_modules\#angular\cli\node_modules\#angular-devkit\core\node\resolve.js:141:11)
at Observable.rxjs_1.Observable [as _subscribe] (C:\Users\asus\AppData\Roaming\npm\node_modules\#angular\cli\node_modules\#angular-devkit\architect\src\architect.js:132:40)
at Observable._trySubscribe (C:\Users\asus\AppData\Roaming\npm\node_modules\#angular\cli\node_modules\rxjs\internal\Observable.js:44:25)
at Observable.subscribe (C:\Users\asus\AppData\Roaming\npm\node_modules\#angular\cli\node_modules\rxjs\internal\Observable.js:30:22)
at C:\Users\asus\AppData\Roaming\npm\node_modules\#angular\cli\node_modules\rxjs\internal\Observable.js:99:19
at new Promise (<anonymous>)
at Observable.toPromise (C:\Users\asus\AppData\Roaming\npm\node_modules\#angular\cli\node_modules\rxjs\internal\Observable.js:97:16)
at ServeCommand.initialize (C:\Users\asus\AppData\Roaming\npm\node_modules\#angular\cli\models\architect-command.js:88:94)
at process._tickCallback (internal/process/next_tick.js:68:7)
at Function.Module.runMain (internal/modules/cjs/loader.js:744:11)
project live example https://stackblitz.com/angular/bvypgkmlmdv
Download link https://angular.io/generated/zips/toh-pt3/toh-pt3.zip
You haven't installed the node modules.
Kindly run the following command npm install and run the application.
You need to install the node modules first.
For that you need to run npm i in the root folder of your downloaded app
(and you need also to have npm installed)
First install NodeJS to your computer, then install npm package manager using global key,
npm i npm -g
And afer that you can install npm packages depending your package.json file as answered previous message.
npm i
Related
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
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
Im getting this error trying to install dependencies from bower.json (bower install) and i don't know what is it or how i can fix it... any help would be apreciated.
✘ deniz946#UbuntuOS ~/Desktop/meanapp/client resourcejs bower install
/home/deniz946/.nvm/versions/node/v5.0.0/lib/node_modules/bower/lib/node_modules/configstore/index.js:54
throw err;
^
Error: EACCES: permission denied, open '/home/deniz946/.config/configstore/bower-github.json'
You don't have access to this file.
at Error (native)
at Object.fs.openSync (fs.js:584:18)
at Object.fs.readFileSync (fs.js:431:33)
at Object.create.all.get (/home/deniz946/.nvm/versions/node/v5.0.0/lib/node_modules/bower/lib/node_modules/configstore/index.js:35:26)
at Object.Configstore (/home/deniz946/.nvm/versions/node/v5.0.0/lib/node_modules/bower/lib/node_modules/configstore/index.js:28:44)
at readCachedConfig (/home/deniz946/.nvm/versions/node/v5.0.0/lib/node_modules/bower/lib/config.js:19:23)
at defaultConfig (/home/deniz946/.nvm/versions/node/v5.0.0/lib/node_modules/bower/lib/config.js:11:12)
at Object.<anonymous> (/home/deniz946/.nvm/versions/node/v5.0.0/lib/node_modules/bower/lib/index.js:16:32)
at Module._compile (module.js:425:26)
at Object.Module._extensions..js (module.js:432:10)
This command should work . It provide permission to bower configration.
sudo chown -R $USER:$GROUP ~/.npm
sudo chown -R $USER:$GROUP ~/.config
and also give permission to folder by
sudo chmod -R 777 foldername
.
You are facing access permissions error. Use sudo:
sudo bower install
EDIT:
sudo does not seem to be working with bower install. This works for me though:
bower install --allow-root
For a more exotic take, where you are running as root in Docker and experiencing this, one should know that NPM is running as the owner of the current working directory. So in case you are root and does not work no matter what you try, try listing the files and see if they are owned by root. If not, it will never work, unless you change the ownership to root.
See this answer for the full explanation and references to source code in NPM.
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.
Setup:
I have NodeJS installed on my system (C) drive on a Windows 8 x64 machine. I have QUnit installed globally via npm:
npm install qunit -g
The problem:
If I attempt to reference QUnit with:
var q = require('qunit');
while running NodeJS from any directory on the C drive, everything works as expected. However, when I run it from my projects directory which resides on my secondary E drive, Node cannot find my globally installed package:
Error: Cannot find module 'qunit'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:362:17)
at require (module.js:378:17)
at repl:1:9
at REPLServer.self.eval (repl.js:109:21)
at rli.on.self.bufferedCmd (repl.js:258:20)
at REPLServer.self.eval (repl.js:116:5)
at Interface.<anonymous> (repl.js:248:12)
at Interface.EventEmitter.emit (events.js:96:17)
Is there some other configuration I'm missing to be able to use globally installed packages while running NodeJS from my secondary drive? Is this just unsupported? I'd like to not have to locally install them and check them into source control, but it is a backup option if global packages do not work from secondary drives.
https://npmjs.org/doc/folders.html
Local install (default): puts stuff in ./node_modules of the current package root.
Global install (with -g): puts stuff in /usr/local or wherever node is installed.
Install it locally if you're going to require() it.
Install it globally if you're going to run it on the command line.
If you need both, then install it in both places, or use npm link.
To do this you may want to look into creating a package.json file. Which should include all dependencies for a given project. Then you should be able to run npm install to install all the given dependencies for your project.
There's a related answer here about creating a package.json file.