Node not finding dependencies from Gruntfile - node.js

I've been using the Yeoman fullstack-angular generator, and it was working great about a week ago.
Now, after generating a new app, node is unable to add in the wired-in dependencies in the Gruntfile.js. Basically, I have to install all the dependencies that should be resolved with npm install. After installing about a dozen npm packages, like jit-grunt, jshint, etc, grunt build/serve will finish, but the app doesn't load in the browser.
I'm sure this is a node/npm issue, as the app generator was working about a week ago. I've tried completely uninstalling and reinstalling. Any guesses as to why this is happening?
Although I get the same behavior with different npm versions, right now I'm at:
npm : 3.3.12
node: 4.2.1
grunt-cli: 0.1.13
grunt: 0.4.5
I'm also getting this error message when I'm installing these packages manually, I feel like it might be related:
Ryans-MacBook-Pro:appTest nonzero$ npm install jit-grunt --save-dev
app-test#0.0.0 /Users/nonzero/Programming/appTEST
└── (empty)
npm ERR! code 1

Try to remove local node_modules folder, and then run npm cache clean. Maybe it will help.

Related

node modules deleted. now npm is not installing

I deleted the node modules and package.json.lock file in my client side MERN Stack project folder and tried reinstalling the node modules by typing "npm install" command in the terminal. but it's showing me an error. 1. I have tried clearing cache using "npm cache clean --force".
2. I have tried reinstalling npm using "npm install -g npm".
3. I have tried updating the npm using "npm install -g npm#latest".
But nothing works. Please help me resolve this issue. below are my package.json file and the error in my terminal while installing node modules.
i was expecting that node modules will be reinstalled with all the dependencies mentioned in my package.json file.
NPM changed the way of resolving peer dependencies in v7, but this new way does not allow conflicting dependencies in the dependency tree. The simplest way to solve this would be to use the --legacy-peer-deps option to use the old way of resolving dependencies.
The hard(but better) way to solve it would be to spend some time to update the dependencies in a way that there is no conflicting dependency.

Undefined variable: "$font-weight-bolder" when running npm development server

In a vue project, that is worked on by a lot of people a recently started to get this error when running:
npm run dev
error when starting development server
When running npm install, I also get this warning which might be related to the problem:
npm WARN bootstrap#4.5.0 requires a peer of popper.js#^1.16.0 but none is installed. You must install peer dependencies yourself.
I believe this is happening since I updated my node version, but I'm not sure.
From my research this problem might be related to node-sass or the css-loader.
Details:
Windows 10 64bit
node version: 12.16.3
npm version: 6.14.4
What I've already tried
Completely uninstall node and reinstall it
Try different node versions with nvm (I always deleted node_modules and package.lock and ran npm install again)
Completely delete my git repository and start fresh
Delete node_modules and run "npm ci"
install the css loader
Other development environments work fine so it's most likely something specific with this repository and my machine but I don't really know how to find the problem.
And also, the environment was working fine for me a couple of days ago so it's not a general problem in this repository.

create-react-app command aborting installation Why?

windows 10
node v10.15.1
npm v6.8.0;
I:\>npx create-react-app newpomodoro
Creating a new React app in I:\newpomodoro.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts...
npm ERR! Unexpected end of JSON input while parsing near '...:"^2.2.x","topo":"1.x'
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Administrator\AppData\Roaming\npm-cache_logs\2019-03-03T17_21_57_703Z-debug.log
Aborting installation.
npm install --save --save-exact --loglevel error react react-dom react-scripts has failed.
Deleting generated file... package.json
Deleting newpomodoro/ from I:\
Done.
I installed react globaly and loacaly as well but still it was giving me same error.
Can anyBody tell me whats going wrong.
Use this command:
npm cache clean --force
I am having this same problem with npm install --save --save-exact --loglevel error react react-dom react-scripts has failed. Mine then deletes node_modules and package.json. I have asked about this here: NPX create-react-app aborting installation after vulnerabilities found
I have already tried to use npm cache clean --force but this has not solved the problem. I have also tried installing different versions of node.js to no avail.
I ran into a similar issue. I don't know if you might have been in the same boat, but the cause was a space in my path name. I often save my projects on google file stream which has a space in the name ("G:/My Drive/..."). I tried creating the app in another directory and moving the folder which ended up working out.
The command npm clean --cache won't help.
If you are facing an abort installation error in react.
The abort installation error generated because of the older node version.
you should update your node package version.
To solve, run the following command and it will solve the abort installation error.
nvm install node 12.18.0
So, update your node package to the latest one. Once you've updated your node package then create your react app as follows:
npx create-react-app <your-app-name>
The abort installation error occurred because the outdated version of your node was not supporting the create-react-app command and deleted the node_modules and package.json file
Try this, please. It solved my error and hopefully, it'll solve your error too.
The issue was in node version just update it to latest version and it work's for me!
https://nodejs.org/en/download/
here is the solution which works for me, first of all, you should update all of your dependencies
then ran the command
npm cache clean --force
after that you can use
npx create-react-app

Npm package has too many dependencies

Im new to this all npm thing and I have a question about dependencies.
I started the React tutorial and I have been asked to run the following command:
npm install -g create-react-app
also, for a side project I also rn this following command in the same directory:
npm install react-chartjs-2 chart.js
And suddenly, my node_modules contains 800+ folders of packages.
So I found this site that tells you how many packages your package depends on and it showed me that I depend on only 100+ packages.
I know the meaning of npm install.
I find it really unexplainedable, I will appreaciate any help from your side.
Thank you very much.
install npm-remote-ls globally and check the dependencies of any package you want
npm install npm-remote-ls -g
checking react dependencies: npm-remote-ls react

npm install fails because package is missing in registry

I have an issue with a project where we are using node and brunch. The issue is current specific to brunch, but could occur for any module would be my guess.
The easiest way to currently reproduce this, is to do the following in a new folder:
npm init
npm install --save-dev brunch
The issue here is that brunch depends on loggy, which in turn depends on ansi-color, which no longer has an entry in the npmregistry:
https://registry.npmjs.org/ansi-color
I think this might be the github project: https://github.com/loopj/commonjs-ansi-color
In any case, I am unable to proceed, and all our builds fail because they are not able to fetch the given dependency.
I could perhaps use npm shrinkwrap in some way, but that depends on the modules already existing in node_modules, which I am currently missing.
So how can I force npm to use ansi-color from a different location, or ignore the dependency?
Not sure about npm 2 but you can fix this with beta npm 3. npm 3 has flat node_modules directory. So sub modules can sit in the top level. Read the Changelog.
The missing modules can be installed directly from their Github repo as a toplevel dependency in your project. If npm finds the module with the same version in node_modules directory, it won't look for it anymore in the registry.
Install npm 3:
npm install -g npm#3-latest
Then install depencies:
//install missing module from other location
npm install https://github.com/loopj/commonjs-ansi-color.git --save-dev
npm install --save-dev brunch
It looks like ansi-color is back on the npm registry ("https://registry.npmjs.org/ansi-color" is back online)

Resources